update_blog_details() WordPress Function

This function is used to update the details of a blog. It takes two arguments: the blog ID and an array of fields to update. The array keys are the field names and the values are the new values. It returns true if the update was successful, false otherwise.

update_blog_details( int $blog_id, array $details = array() ) #

Update the details for a blog. Updates the blogs table for a given blog ID.


Parameters

$blog_id

(int)(Required)Blog ID.

$details

(array)(Optional)Array of details keyed by blogs table field names.

Default value: array()


Top ↑

Return

(bool) True if update succeeds, false otherwise.


Top ↑

Source

File: wp-includes/ms-blogs.php

function update_blog_details( $blog_id, $details = array() ) {
	global $wpdb;

	if ( empty( $details ) ) {
		return false;
	}

	if ( is_object( $details ) ) {
		$details = get_object_vars( $details );
	}

	$site = wp_update_site( $blog_id, $details );

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

	return true;
}


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.