Make WordPress Core

Ticket #20037: 20337.diff

File 20337.diff, 738 bytes (added by Mte90, 7 years ago)

new refreshed patch

  • src/wp-includes/general-template.php

     
    28092809 * @since 3.3.0
    28102810 */
    28112811function wp_no_robots() {
    2812         echo "<meta name='robots' content='noindex,follow' />\n";
     2812        global $wp_query;
     2813        $post = $wp_query->get_queried_object();         
     2814       
     2815        $robots_meta = ( !$post || '0' == get_option('blog_public') ? 'noindex, nofollow' : '' );
     2816       
     2817        $robots_meta = apply_filters( 'wp_no_robots' , $robots_meta , $post );
     2818                         
     2819        if ( $robots_meta != '' ) {
     2820                echo "<meta name='robots' content='" . $robots_meta . "' />\n"; 
     2821        }
    28132822}
    28142823
    28152824/**