Changeset 9185 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/search.php
- Timestamp:
- 10/15/2019 10:00:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/search.php
r9000 r9185 25 25 add_filter( 'posts_orderby', array( __CLASS__, 'search_posts_orderby' ), 10, 2 ); 26 26 add_filter( 'the_posts', array( __CLASS__, 'rerun_empty_search' ), 10, 2 ); 27 add_action( 'wp_head', array( __CLASS__, 'noindex_for_search' ) );28 } 29 30 /** 31 * Outputs `noindex,follow` robots tag for search results.27 add_action( 'wp_head', array( __CLASS__, 'noindex_for_search' ), 9 ); 28 } 29 30 /** 31 * Outputs `noindex,follow` robots tag for search and post_type-filtered results. 32 32 */ 33 33 public static function noindex_for_search() { 34 if ( is_search() ) {34 if ( is_search() || isset( $_GET[ 'post_type' ] ) ) { 35 35 wp_no_robots(); 36 36 }
Note: See TracChangeset
for help on using the changeset viewer.