Making WordPress.org

Changeset 8535


Ignore:
Timestamp:
03/26/2019 10:46:23 PM (5 years ago)
Author:
coffee2code
Message:

Theme Directory: Output X-Robots-Tag: noindex in feeds for tags.

Props jonoaldersonwp, coffee2code.
Fixes #4337.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php

    r8191 r8535  
    11771177
    11781178/**
     1179 * Outputs X-Robots-Tag with noindex for feeds.
     1180 */
     1181function wporg_themes_noindex_for_feeds() {
     1182    if ( is_tag() ) {
     1183        header( 'X-Robots-Tag: noindex' );
     1184    }
     1185}
     1186add_action( 'themes_custom_feed_head', 'wporg_themes_noindex_for_feeds' );
     1187
     1188/**
    11791189 * Outputs a <link rel="canonical"> on archive pages.
    11801190 */
Note: See TracChangeset for help on using the changeset viewer.