WordPress.org

Making WordPress.org

Changeset 9202


Ignore:
Timestamp:
10/17/2019 06:24:27 PM (4 months ago)
Author:
coffee2code
Message:

Breathe: Output a 'noindex,follow' meta tag for date-based archives.

Props jonoaldersonwp, coffee2code.
Fixes #4688.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r9186 r9202  
    3838
    3939/**
    40  * Outputs a 'noindex,follow' meta tag for search results.
    41  */
    42 function no_robots_search_results() {
    43     if ( is_search() ) {
     40 * Outputs a 'noindex,follow' `meta` tag when appropriate.
     41 *
     42 * Currently applies to:
     43 * - date-based archives
     44 * - search results
     45 */
     46function no_robots() {
     47    if (
     48        is_search()
     49    ||
     50        is_date()
     51    ) {
    4452        wp_no_robots();
    4553    }
    4654}
    47 add_action( 'wp_head', __NAMESPACE__ . '\no_robots_search_results', 9 );
     55add_action( 'wp_head', __NAMESPACE__ . '\no_robots', 9 );
    4856
    4957
Note: See TracChangeset for help on using the changeset viewer.