get_user_setting()
Retrieves user interface setting value based on setting name.
No Hooks.
Return
Mixed
. The last saved user setting or the default value/false if it doesn't exist.
Usage
get_user_setting( $name, $default_value );
- $name(string) (required)
- The name of the setting.
- $default_value(string|false)
- Default false.
Default: value to return when $name is not set
Changelog
Since 2.7.0 | Introduced. |
get_user_setting() get user setting code WP 6.6.1
function get_user_setting( $name, $default_value = false ) { $all_user_settings = get_all_user_settings(); return isset( $all_user_settings[ $name ] ) ? $all_user_settings[ $name ] : $default_value; }