W3cubDocs

/WordPress

update_blog_status( int $blog_id, string $pref, string $value, null $deprecated = null )

Update a blog details field.

Description

Parameters

$blog_id

(int) (Required) BLog ID

$pref

(string) (Required) A field name

$value

(string) (Required) Value for $pref

$deprecated

(null) (Optional)

Default value: null

Return

(string|false) $value

Source

File: wp-includes/ms-blogs.php

function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
	global $wpdb;

	if ( null !== $deprecated ) {
		_deprecated_argument( __FUNCTION__, '3.1.0' );
	}

	if ( ! in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ) ) ) {
		return $value;
	}

	$result = wp_update_site(
		$blog_id,
		array(
			$pref => $value,
		)
	);

	if ( is_wp_error( $result ) ) {
		return false;
	}

	return $value;
}

Changelog

Version Description
MU (3.0.0) MU (3.0.0)
5.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/update_blog_status