Advertisements

delete_user_setting

Definition:
function delete_user_setting( $names ) {}

Delete user interface settings.
Deleting settings would reset them to the defaults. This function has to be used before any output has started as it calls setcookie().

Parameters

  • mixed $names: The name or array of names of the setting to be deleted.

Return values

returns:true if deleted successfully/false if not.

Source code

function delete_user_setting( $names ) {



	if ( headers_sent() )

		return false;



	$all = get_all_user_settings();

	$names = (array) $names;



	foreach ( $names as $name ) {

		if ( isset($all[$name]) ) {

			unset($all[$name]);

			$deleted = true;

		}

	}



	if ( isset($deleted) )

		return wp_set_all_user_settings($all);



	return false;

}

824

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: