wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



update_blog_option › WordPress Function

Depuis
Dépréciéen/a
update_blog_option ( $id, $option, $value, $deprecated = null )
Paramètres: (4)
  • (int) $id The blog ID.
    Requis: Oui
  • (string) $option The option key.
    Requis: Oui
  • (mixed) $value The option value.
    Requis: Oui
  • (mixed) $deprecated Not used.
    Requis: Non
    Défaut: null
Retourne:
  • (bool) True if the value was updated, false otherwise.
Défini(e) dans:
Codex:
Changelog:
  • MU

Updates an option for a particular blog.



Source

function update_blog_option( $id, $option, $value, $deprecated = null ) {
	$id = (int) $id;

	if ( null !== $deprecated ) {
		_deprecated_argument( __FUNCTION__, '3.1.0' );
	}

	if ( get_current_blog_id() === $id ) {
		return update_option( $option, $value );
	}

	switch_to_blog( $id );
	$return = update_option( $option, $value );
	restore_current_blog();

	return $return;
}