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


git-svn-id: https://develop.svn.wordpress.org/trunk@23794 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2013-03-25 09:29:58 +00:00
parent e9746944fa
commit 315f606306
3 changed files with 18 additions and 4 deletions
+15 -1
View File
@@ -1703,8 +1703,22 @@ function wlwmanifest_link() {
* @since 2.1.0
*/
function noindex() {
$public = get_option( 'blog_public' );
if ( is_multisite() ) {
// Compare local and global and override with the local setting if they
// don't match.
global $current_blog;
if ( ( '' != $public ) && ( $public != $current_blog->public ) ) {
update_blog_status( get_current_blog_id(), 'public', $public );
$current_blog->public = $public;
}
}
// If the blog is not public, tell robots to go away.
if ( '0' == get_option('blog_public') )
if ( '0' == $public )
wp_no_robots();
}