WordPress.org

Making WordPress.org

Changeset 9866


Ignore:
Timestamp:
05/13/2020 05:07:53 AM (7 months ago)
Author:
dd32
Message:

Developer: Remove specific SEO fixes that are included in the generic SEO fixes plugin.

See #5173.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/search.php

    r9369 r9866  
    2727        add_filter( 'the_posts',     array( __CLASS__, 'redirect_empty_search' ), 10, 2 );
    2828        add_filter( 'the_posts',     array( __CLASS__, 'rerun_search_without_results' ), 10, 2 );
    29         add_action( 'wp_head',       array( __CLASS__, 'noindex_for_search' ), 9 );
    30     }
    31 
    32     /**
    33      * Outputs `noindex,follow` robots tag for search and post_type-filtered results.
    34      */
    35     public static function noindex_for_search() {
    36         if ( is_search() || isset( $_GET[ 'post_type' ] ) ) {
    37             wp_no_robots();
    38         }
     29
     30        add_filter( 'wporg_noindex_request', array( __CLASS__, 'noindex_query' ) );
     31    }
     32
     33    /**
     34     * Noindex post_type-filtered results.
     35     */
     36    public static function noindex_query( $noindex ) {
     37        if ( isset( $_GET[ 'post_type' ] ) ) {
     38            $noindex = true;
     39        }
     40
     41        return $noindex;
    3942    }
    4043
Note: See TracChangeset for help on using the changeset viewer.