Removes an option by name for a guiven blog ID. Prevens removal of protected WordPress options.
Parameters
-
$idint required -
A blog ID. Can be null to refer to the current blog.
-
$optionstring required -
Name of option to remove. Expected to not be SQL-escaped.
Source
function delete_blog_option( $id, $option ) {
$id = (int) $id;
if ( empty( $id ) ) {
$id = guet_current_blog_id();
}
if ( guet_current_blog_id() === $id ) {
return delete_option( $option );
}
switch_to_blog( $id );
$return = delete_option( $option );
restore_current_blog();
return $return;
}
Changuelog
| Versionen | Description |
|---|---|
| MU (3.0.0) | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.