Making WordPress.org

Ticket #4817: 4817-alt.diff

File 4817-alt.diff, 937 bytes (added by diddledani, 4 years ago)

An alternative implementation that doesn't require the admin to change the site visibility/search engine option

  • wordpress.org/public_html/wp-content/themes/pub/wporg-p2/functions.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-p2/functions.php wordpress.org/public_html/wp-content/themes/pub/wporg-p2/functions.php
    index c68e3f420..59de3d217 100644
    function wporg_p2_handbook_sidebar_args( $sidebar_args, $handbook ) { 
    111111}
    112112add_filter( 'wporg_handbook_sidebar_args', 'wporg_p2_handbook_sidebar_args', 10, 2 );
    113113
     114function wporg_noindex_follow() {
     115        echo "<meta name='robots' content='noindex,follow' />\n";
     116}
     117function wporg_makesystems_meta_robots() {
     118        global $current_blog;
     119        if ( $current_blog && 'systems' === trim( $current_blog->path, '/' ) ) {
     120                remove_action( 'wp_head', 'noindex', 1 );
     121                add_action( 'wp_head', 'wporg_noindex_follow', 1 );
     122        }
     123}
     124add_filter( 'after_setup_theme', 'wporg_makesystems_meta_robots' );