update_blog_public() WordPress Function

The update_blog_public() function is used to change the visibility of a blog. This function takes two parameters: the blog id and the visibility. The visibility can be set to 'public', 'hidden', or 'private'. If the visibility is set to 'public', the blog will be visible to everyone. If the visibility is set to 'hidden', the blog will be visible only to registered users. If the visibility is set to 'private', the blog will be visible only to the blog owner.

update_blog_public( int $old_value, int $value ) #

Updates this blog’s ‘public’ setting in the global blogs table.


Description

Public blogs have a setting of 1, private blogs are 0.


Top ↑

Parameters

$old_value

(int)(Required)

$value

(int)(Required)The new public value


Top ↑

Source

File: wp-includes/ms-functions.php

function update_blog_public( $old_value, $value ) {
	update_blog_status( get_current_blog_id(), 'public', (int) $value );
}


Top ↑

Changelog

Changelog
VersionDescription
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More