de

wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren




delete_user_setting [ WordPress Function ]

delete_user_setting ( $names )
Parameter:
  • (mixed) $names The name or array of names of the setting to be deleted.
Gibt zurück:
  • (bool) true if deleted successfully/false if not.
Definiert in:



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

Beispiele [ wp-snippets.com ]

Top Google Suchergebnisse

Mehr ...

Nutzerduskussionen [ wordpress.org ]

0 Nutzerkommentare

Noch keine. Sei der Erste!

Neu hinzufügen ...



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