Make WordPress Core

Ticket #19251: 19251.2.diff

File 19251.2.diff, 3.5 KB (added by nacin, 13 years ago)

Patch I worked up independently.

  • wp-signup.php

     
    33/** Sets up the WordPress Environment. */
    44require( dirname(__FILE__) . '/wp-load.php' );
    55
    6 add_action( 'wp_head', 'signuppageheaders' ) ;
     6add_action( 'wp_head', '_wp_render_meta_robots_noindex' );
    77
    88require( './wp-blog-header.php' );
    99
     
    1717}
    1818add_action( 'wp_head', 'do_signup_header' );
    1919
    20 function signuppageheaders() {
    21         echo "<meta name='robots' content='noindex,nofollow' />\n";
    22 }
    23 
    2420if ( !is_multisite() ) {
    2521        wp_redirect( site_url('wp-login.php?action=register') );
    2622        die();
  • wp-login.php

     
    4242        global $error, $is_iphone, $interim_login, $current_site;
    4343
    4444        // Don't index any of these forms
    45         add_filter( 'pre_option_blog_public', '__return_zero' );
    46         add_action( 'login_head', 'noindex' );
     45        add_action( 'login_head', '_wp_render_meta_robots_noindex' );
    4746
    4847        if ( empty($wp_error) )
    4948                $wp_error = new WP_Error();
  • wp-includes/default-filters.php

     
    219219add_action( 'after_switch_theme',  '_wp_sidebars_changed'                   );
    220220
    221221if ( isset( $_GET['replytocom'] ) )
    222     add_filter( 'pre_option_blog_public', '__return_zero' );
     222    add_filter( 'wp_head', '_wp_render_meta_robots_noindex' );
    223223
    224224// Login actions
    225225add_action( 'login_head',          'wp_print_head_scripts',         9     );
  • wp-includes/functions.php

     
    18491849
    18501850        $output = "User-agent: *\n";
    18511851        $public = get_option( 'blog_public' );
    1852         if ( '0' ==  $public ) {
     1852        if ( '0' == $public ) {
    18531853                $output .= "Disallow: /\n";
    18541854        } else {
    18551855                $site_url = parse_url( site_url() );
  • wp-includes/general-template.php

     
    16841684function noindex() {
    16851685        // If the blog is not public, tell robots to go away.
    16861686        if ( '0' == get_option('blog_public') )
    1687                 echo "<meta name='robots' content='noindex,nofollow' />\n";
     1687                _wp_render_meta_robots_noindex();
    16881688}
    16891689
     1690function _wp_render_meta_robots_noindex() {
     1691        echo "<meta name='robots' content='noindex,nofollow' />\n";
     1692}
     1693
    16901694/**
    16911695 * Determine if TinyMCE is available.
    16921696 *
  • wp-admin/options-writing.php

     
    157157<?php if ( apply_filters( 'enable_update_services_configuration', true ) ) { ?>
    158158<h3><?php _e('Update Services') ?></h3>
    159159
    160 <?php if ( get_option('blog_public') ) : ?>
     160<?php if ( 1 == get_option('blog_public') ) : ?>
    161161
    162162<p><label for="ping_sites"><?php _e('When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="http://codex.wordpress.org/Update_Services">Update Services</a> on the Codex. Separate multiple service <abbr title="Universal Resource Locator">URL</abbr>s with line breaks.') ?></label></p>
    163163