Make WordPress Core


Ignore:
Timestamp:
03/25/2013 09:29:58 AM (12 years ago)
Author:
ryan
Message:

Fire the update_blog_public action from update_blog_status() instead of update_blog_public(). Pass blog ID and value to the action.

Add code to noindex() to sync the 'public' value in the site options table with the blog_public value in the options table.

fixes #23155

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r23709 r23794  
    17041704 */
    17051705function noindex() {
     1706    $public = get_option( 'blog_public' );
     1707
     1708    if ( is_multisite() ) {
     1709        // Compare local and global and override with the local setting if they
     1710        // don't match.
     1711
     1712        global $current_blog;
     1713
     1714        if ( ( '' != $public ) && ( $public != $current_blog->public ) ) {
     1715            update_blog_status( get_current_blog_id(), 'public', $public );
     1716            $current_blog->public = $public;
     1717        }
     1718    }
     1719
    17061720    // If the blog is not public, tell robots to go away.
    1707     if ( '0' == get_option('blog_public') )
     1721    if ( '0' == $public )
    17081722        wp_no_robots();
    17091723}
Note: See TracChangeset for help on using the changeset viewer.