Changeset 50371
- Timestamp:
- 02/17/2021 10:49:13 AM (4 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-filters.php
r50370 r50371 239 239 // Robots filters. 240 240 add_filter( 'wp_robots', 'wp_robots_noindex' ); 241 add_filter( 'wp_robots', 'wp_robots_noindex_embeds' ); 241 242 add_filter( 'wp_robots', 'wp_robots_noindex_search' ); 242 243 add_filter( 'wp_robots', 'wp_robots_max_image_preview_large' ); … … 612 613 add_action( 'embed_footer', 'wp_print_footer_scripts', 20 ); 613 614 614 add_filter( 'wp_robots', 'wp_embed_no_robots' );615 615 add_filter( 'excerpt_more', 'wp_embed_excerpt_more', 20 ); 616 616 add_filter( 'the_excerpt_embed', 'wptexturize' ); -
trunk/src/wp-includes/embed.php
r49992 r50371 1244 1244 return $result; 1245 1245 } 1246 1247 /**1248 * Adds noindex to the robots meta tag for embeds.1249 *1250 * Typical usage is as a {@see 'wp_robots'} callback:1251 *1252 * add_filter( 'wp_robots', 'wp_embed_no_robots' );1253 *1254 * @since 5.7.01255 *1256 * @param array $robots Associative array of robots directives.1257 * @return array Filtered robots directives.1258 */1259 function wp_embed_no_robots( array $robots ) {1260 if ( ! is_embed() ) {1261 return $robots;1262 }1263 1264 return wp_robots_no_robots( $robots );1265 } -
trunk/src/wp-includes/robots-template.php
r50370 r50371 75 75 * 76 76 * @since 5.7.0 77 * 77 78 * @see wp_robots_no_robots() 78 79 * … … 89 90 90 91 /** 92 * Adds noindex to the robots meta tag for embeds. 93 * 94 * Typical usage is as a {@see 'wp_robots'} callback: 95 * 96 * add_filter( 'wp_robots', 'wp_robots_noindex_embeds' ); 97 * 98 * @since 5.7.0 99 * 100 * @see wp_robots_no_robots() 101 * 102 * @param array $robots Associative array of robots directives. 103 * @return array Filtered robots directives. 104 */ 105 function wp_robots_noindex_embeds( array $robots ) { 106 if ( is_embed() ) { 107 return wp_robots_no_robots( $robots ); 108 } 109 110 return $robots; 111 } 112 113 /** 91 114 * Adds noindex to the robots meta tag if a search is being performed. 92 115 * … … 100 123 * 101 124 * @since 5.7.0 125 * 102 126 * @see wp_robots_no_robots() 103 127 *
Note: See TracChangeset
for help on using the changeset viewer.