Make WordPress Core

Changeset 23794


Ignore:
Timestamp:
03/25/2013 09:29:58 AM (13 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

Location:
trunk/wp-includes
Files:
3 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}
  • trunk/wp-includes/ms-blogs.php

    r23752 r23794  
    696696    elseif ( 'deleted' == $pref )
    697697        ( $value == 1 ) ? do_action( 'make_delete_blog', $blog_id ) : do_action( 'make_undelete_blog', $blog_id );
     698    elseif ( 'public' == $pref )
     699        do_action( 'update_blog_public', $blog_id, $value ); // Moved here from update_blog_public().
    698700
    699701    return $value;
  • trunk/wp-includes/ms-functions.php

    r23664 r23794  
    17351735 */
    17361736function update_blog_public( $old_value, $value ) {
    1737     global $wpdb;
    1738     do_action('update_blog_public');
    1739     update_blog_status( $wpdb->blogid, 'public', (int) $value );
     1737    update_blog_status( get_current_blog_id(), 'public', (int) $value );
    17401738}
    17411739add_action('update_option_blog_public', 'update_blog_public', 10, 2);
Note: See TracChangeset for help on using the changeset viewer.