update_blog_details()WP 3.0.0

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

Хуков нет.

Возвращает

true|false. True if update succeeds, false otherwise.

Использование

update_blog_details( $blog_id, $details );
$blog_id(int) (обязательный)
Blog ID.
$details(массив)
Array of details keyed by blogs table field names.
По умолчанию: array()

Заметки

  • Global. wpdb. $wpdb WordPress database abstraction object.

Список изменений

С версии 3.0.0 Введена.

Код update_blog_details() WP 6.5.2

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