wpseek.com
A WordPress-centric search engine for devs and theme authors



delete_blog_option › WordPress Function

Since
Deprecatedn/a
delete_blog_option ( $id, $option )
Parameters: (2)
  • (int) $id A blog ID. Can be null to refer to the current blog.
    Required: Yes
  • (string) $option Name of option to remove. Expected to not be SQL-escaped.
    Required: Yes
Returns:
  • (bool) True if the option was deleted, false otherwise.
Defined at:
Codex:
Change Log:
  • MU

Removes an option by name for a given blog ID. Prevents removal of protected WordPress options.



Source

function delete_blog_option( $id, $option ) {
	$id = (int) $id;

	if ( empty( $id ) ) {
		$id = get_current_blog_id();
	}

	if ( get_current_blog_id() === $id ) {
		return delete_option( $option );
	}

	switch_to_blog( $id );
	$return = delete_option( $option );
	restore_current_blog();

	return $return;
}