update_blog_details

函数


update_blog_details ( $blog_id, $details = array() )
参数
  • (int)
    $blog_id
    Blog ID.
    Required:
  • (array)
    $details
    Array of details keyed by blogs table field names.
    Required:
    Default: array()
返回值
  • (bool) True if update succeeds, false otherwise.
定义位置
  • wp-includes/ms-blogs.php
    , line 302
引入
弃用

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

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;
}