Uses
Uses | Description |
---|---|
wp-includes/option.php: get_all_user_settings() | Retrieves all user interface settings. |
wp-includes/option.php: wp_set_all_user_settings() | Private. Sets all user interface settings. |
Adds or updates user interface setting.
Both $name and $value can contain only ASCII letters, numbers, hyphens, and underscores.
This function has to be used before any output has started as it calls setcookie().
(string) (Required) The name of the setting.
(string) (Required) The value for the setting.
(bool|null) True if set successfully, false otherwise. Null if the current user is not a member of the site.
File: wp-includes/option.php
function set_user_setting( $name, $value ) { if ( headers_sent() ) { return false; } $all_user_settings = get_all_user_settings(); $all_user_settings[ $name ] = $value; return wp_set_all_user_settings( $all_user_settings ); }
Version | Description |
---|---|
2.8.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/set_user_setting