On this page
update_blog_option( int $id, string $option, mixed $value, mixed $deprecated = null ): bool
Update an option for a particular blog.
Parameters
$idint Required-
The blog ID.
$optionstring Required-
The option key.
$valuemixed Required-
The option value.
$deprecatedmixed Optional-
Not used.
Default:
null
Return
bool True if the value was updated, false otherwise.
Source
File: wp-includes/ms-blogs.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| switch_to_blog() wp-includes/ms-blogs.php | Switch the current blog. |
| restore_current_blog() wp-includes/ms-blogs.php | Restore the current blog, after calling switch_to_blog() . |
| get_current_blog_id() wp-includes/load.php | Retrieve the current site ID. |
| _deprecated_argument() wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
| update_option() wp-includes/option.php | Updates the value of an option that was already added. |
Used By
| Used By | Description |
|---|---|
| wp_update_blog_public_option_on_site_update() wp-includes/ms-site.php | Updates the |
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/update_blog_option