mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@50371 git-svn-id: http://core.svn.wordpress.org/trunk@49982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b51a707468
commit
a9d04adf20
@ -238,6 +238,7 @@ add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
|
||||
|
||||
// Robots filters.
|
||||
add_filter( 'wp_robots', 'wp_robots_noindex' );
|
||||
add_filter( 'wp_robots', 'wp_robots_noindex_embeds' );
|
||||
add_filter( 'wp_robots', 'wp_robots_noindex_search' );
|
||||
add_filter( 'wp_robots', 'wp_robots_max_image_preview_large' );
|
||||
|
||||
@ -611,7 +612,6 @@ add_action( 'embed_footer', 'print_embed_sharing_dialog' );
|
||||
add_action( 'embed_footer', 'print_embed_scripts' );
|
||||
add_action( 'embed_footer', 'wp_print_footer_scripts', 20 );
|
||||
|
||||
add_filter( 'wp_robots', 'wp_embed_no_robots' );
|
||||
add_filter( 'excerpt_more', 'wp_embed_excerpt_more', 20 );
|
||||
add_filter( 'the_excerpt_embed', 'wptexturize' );
|
||||
add_filter( 'the_excerpt_embed', 'convert_chars' );
|
||||
|
@ -1246,23 +1246,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 );
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ function wp_robots() {
|
||||
* add_filter( 'wp_robots', 'wp_robots_noindex' );
|
||||
*
|
||||
* @since 5.7.0
|
||||
*
|
||||
* @see wp_robots_no_robots()
|
||||
*
|
||||
* @param array $robots Associative array of robots directives.
|
||||
@ -87,6 +88,28 @@ function wp_robots_noindex( array $robots ) {
|
||||
return $robots;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds noindex to the robots meta tag for embeds.
|
||||
*
|
||||
* Typical usage is as a {@see 'wp_robots'} callback:
|
||||
*
|
||||
* add_filter( 'wp_robots', 'wp_robots_noindex_embeds' );
|
||||
*
|
||||
* @since 5.7.0
|
||||
*
|
||||
* @see wp_robots_no_robots()
|
||||
*
|
||||
* @param array $robots Associative array of robots directives.
|
||||
* @return array Filtered robots directives.
|
||||
*/
|
||||
function wp_robots_noindex_embeds( array $robots ) {
|
||||
if ( is_embed() ) {
|
||||
return wp_robots_no_robots( $robots );
|
||||
}
|
||||
|
||||
return $robots;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds noindex to the robots meta tag if a search is being performed.
|
||||
*
|
||||
@ -99,6 +122,7 @@ function wp_robots_noindex( array $robots ) {
|
||||
* add_filter( 'wp_robots', 'wp_robots_noindex_search' );
|
||||
*
|
||||
* @since 5.7.0
|
||||
*
|
||||
* @see wp_robots_no_robots()
|
||||
*
|
||||
* @param array $robots Associative array of robots directives.
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.7-beta3-50370';
|
||||
$wp_version = '5.7-beta3-50371';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user