Switch language

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




delete_user_setting [ WordPress Function ]

delete_user_setting ( $names )
Parameters:
  • (mixed) $names The name or array of names of the setting to be deleted.
Returns:
  • (bool) true if deleted successfully/false if not.
Defined at:



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().

Source


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

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

User discussions [ wordpress.org ]

0 User Note(s)

None yet. Be the first!

Add New ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics