Skip to content

Commit

Permalink
Docs: Adjust DocBlock formatting for wp_robots_*() and related func…
Browse files Browse the repository at this point in the history
…tions.

This ensures the code blocks are displayed correctly in the WordPress Code Reference.

Follow-up to [19304], [37541], [44021], [49992].

See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@53087 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Apr 6, 2022
1 parent 6620cef commit 342cd8c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
30 changes: 17 additions & 13 deletions src/wp-includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4125,11 +4125,10 @@ function addslashes_strings_only( $value ) {
}

/**
* Displays a noindex meta tag if required by the blog configuration.
* Displays a `noindex` meta tag if required by the blog configuration.
*
* If a blog is marked as not being public then the noindex meta tag will be
* output to tell web robots not to index the page content. Add this to the
* {@see 'wp_head'} action.
* If a blog is marked as not being public then the `noindex` meta tag will be
* output to tell web robots not to index the page content.
*
* Typical usage is as a {@see 'wp_head'} callback:
*
Expand All @@ -4150,13 +4149,16 @@ function noindex() {
}

/**
* Display a noindex meta tag.
* Display a `noindex` meta tag.
*
* Outputs a noindex meta tag that tells web robots not to index the page content.
* Typical usage is as a {@see 'wp_head'} callback. add_action( 'wp_head', 'wp_no_robots' );
* Outputs a `noindex` meta tag that tells web robots not to index the page content.
*
* Typical usage is as a {@see 'wp_head'} callback:
*
* add_action( 'wp_head', 'wp_no_robots' );
*
* @since 3.3.0
* @since 5.3.0 Echo "noindex,nofollow" if search engine visibility is discouraged.
* @since 5.3.0 Echo `noindex,nofollow` if search engine visibility is discouraged.
* @deprecated 5.7.0 Use wp_robots_no_robots() instead on 'wp_robots' filter.
*/
function wp_no_robots() {
Expand All @@ -4171,13 +4173,15 @@ function wp_no_robots() {
}

/**
* Display a noindex,noarchive meta tag and referrer origin-when-cross-origin meta tag.
* Display a `noindex,noarchive` meta tag and referrer `strict-origin-when-cross-origin` meta tag.
*
* Outputs a noindex,noarchive meta tag that tells web robots not to index or cache the page content.
* Outputs a referrer origin-when-cross-origin meta tag that tells the browser not to send the full
* url as a referrer to other sites when cross-origin assets are loaded.
* Outputs a `noindex,noarchive` meta tag that tells web robots not to index or cache the page content.
* Outputs a referrer `strict-origin-when-cross-origin` meta tag that tells the browser not to send
* the full URL as a referrer to other sites when cross-origin assets are loaded.
*
* Typical usage is as a {@see 'wp_head'} callback:
*
* Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_sensitive_page_meta' );
* add_action( 'wp_head', 'wp_sensitive_page_meta' );
*
* @since 5.0.1
* @deprecated 5.7.0 Use wp_robots_sensitive_page() instead on 'wp_robots' filter
Expand Down
10 changes: 6 additions & 4 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -3224,12 +3224,14 @@ function wlwmanifest_link() {
}

/**
* Displays a referrer strict-origin-when-cross-origin meta tag.
* Displays a referrer `strict-origin-when-cross-origin` meta tag.
*
* Outputs a referrer origin-when-cross-origin meta tag that tells the browser not to send the full
* url as a referrer to other sites when cross-origin assets are loaded.
* Outputs a referrer `strict-origin-when-cross-origin` meta tag that tells the browser not to send
* the full URL as a referrer to other sites when cross-origin assets are loaded.
*
* Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_strict_cross_origin_referrer' );
* Typical usage is as a {@see 'wp_head'} callback:
*
* add_action( 'wp_head', 'wp_strict_cross_origin_referrer' );
*
* @since 5.7.0
*/
Expand Down
12 changes: 6 additions & 6 deletions src/wp-includes/robots-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function wp_robots() {
}

/**
* Adds noindex to the robots meta tag if required by the site configuration.
* Adds `noindex` to the robots meta tag if required by the site configuration.
*
* If a blog is marked as not being public then noindex will be output to
* tell web robots not to index the page content. Add this to the
Expand All @@ -76,7 +76,7 @@ function wp_robots_noindex( array $robots ) {
}

/**
* Adds noindex to the robots meta tag for embeds.
* Adds `noindex` to the robots meta tag for embeds.
*
* Typical usage is as a {@see 'wp_robots'} callback:
*
Expand All @@ -98,7 +98,7 @@ function wp_robots_noindex_embeds( array $robots ) {
}

/**
* Adds noindex to the robots meta tag if a search is being performed.
* Adds `noindex` to the robots meta tag if a search is being performed.
*
* If a search is being performed then noindex will be output to
* tell web robots not to index the page content. Add this to the
Expand All @@ -124,7 +124,7 @@ function wp_robots_noindex_search( array $robots ) {
}

/**
* Adds noindex to the robots meta tag.
* Adds `noindex` to the robots meta tag.
*
* This directive tells web robots not to index the page content.
*
Expand All @@ -150,7 +150,7 @@ function wp_robots_no_robots( array $robots ) {
}

/**
* Adds noindex and noarchive to the robots meta tag.
* Adds `noindex` and `noarchive` to the robots meta tag.
*
* This directive tells web robots not to index or archive the page content and
* is recommended to be used for sensitive pages.
Expand All @@ -171,7 +171,7 @@ function wp_robots_sensitive_page( array $robots ) {
}

/**
* Adds 'max-image-preview:large' to the robots meta tag.
* Adds `max-image-preview:large` to the robots meta tag.
*
* This directive tells web robots that large image previews are allowed to be
* displayed, e.g. in search engines, unless the blog is marked as not being public.
Expand Down

0 comments on commit 342cd8c

Please sign in to comment.