Un motore di ricerca WordPress per sviluppatori e autori di temi



update_blog_status ›

Da5.1.0
Deprecaton/a
update_blog_status ( $blog_id, $pref, $value, $deprecated = null )
Parametri: (4)
  • (int) $blog_id Blog ID.
    Richiesto:
  • (string) $pref Field name.
    Richiesto:
  • (string) $value Field value.
    Richiesto:
  • (null) $deprecated Not used.
    Richiesto: No
    Default: null
Ritorna:
  • (string|false) $value
Definito a:
Codex:
ChangeLog:
  • MU

Update a blog details field.



Sorgenti

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