Robots: Rename wp_embed_no_robots to wp_robots_noindex_embeds().

This brings the naming in line with `wp_robots_noindex_search()`.

Follow-up to [49992], [50370].

See #51511, #52457.

git-svn-id: https://develop.svn.wordpress.org/trunk@50371 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-02-17 10:49:13 +00:00
parent f400eb5ab9
commit 135d567399
3 changed files with 25 additions and 21 deletions

View File

@@ -1243,23 +1243,3 @@ function wp_filter_pre_oembed_result( $result, $url, $args ) {
return $result;
}
/**
* Adds noindex to the robots meta tag for embeds.
*
* Typical usage is as a {@see 'wp_robots'} callback:
*
* add_filter( 'wp_robots', 'wp_embed_no_robots' );
*
* @since 5.7.0
*
* @param array $robots Associative array of robots directives.
* @return array Filtered robots directives.
*/
function wp_embed_no_robots( array $robots ) {
if ( ! is_embed() ) {
return $robots;
}
return wp_robots_no_robots( $robots );
}