update_blog_option()
Updates an option for a particular blog.
Хуков нет.
Возвращает
true|false. True if the value was updated, false otherwise.
Использование
update_blog_option( $id, $option, $value, $deprecated );
- $id(int) (обязательный)
- The blog ID.
- $option(строка) (обязательный)
- The option key.
- $value(разное) (обязательный)
- The option value.
- $deprecated(разное)
- Not used.
По умолчанию: null
Список изменений
| С версии 3.0.0 | Введена. |
Код update_blog_option() update blog option WP 6.9
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;
}