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.
定義位置
相關方法
update_blog_statusget_blog_detailsupdate_blog_optionrefresh_blog_detailsupdate_blog_public
引入
-
棄用
-

update_blog_details: 更新WordPress中一個網路站點的細節: 這個函式更新一個網路站點的名稱、描述和其他細節。

更新一個部落格的詳細資訊。為一個給定的部落格ID更新部落格表。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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;
}
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; }
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;
}

常見問題

FAQs
檢視更多 >