delete_blog_option() WordPress Function

The delete_blog_option() function allows you to delete a blog option by name. This function is only available to super adminstrators.

delete_blog_option( int $id, string $option ) #

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


Parameters

$id

(int)(Required)A blog ID. Can be null to refer to the current blog.

$option

(string)(Required)Name of option to remove. Expected to not be SQL-escaped.


Top ↑

Return

(bool) True if the option was deleted, false otherwise.


Top ↑

Source

File: wp-includes/ms-blogs.php

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


Top ↑

Changelog

Changelog
VersionDescription
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.