A WordPress-centric search engine for devs and theme authors



update_blog_option ›

Since3.0.0
Deprecatedn/a
update_blog_option ( $id, $option, $value, $deprecated = null )
Parameters: (4)
  • (int) $id The blog id.
    Required: Yes
  • (string) $option The option key.
    Required: Yes
  • (mixed) $value The option value.
    Required: Yes
  • (mixed) $deprecated Not used.
    Required: No
    Default: null
Returns:
  • (bool) True on success, false on failure.
Defined at:
Codex:
Change Log:
  • MU

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