get_user_setting()WP 2.7.0

Retrieves user interface setting value based on setting name.

No Hooks.


Mixed. The last saved user setting or the default value/false if it doesn't exist.


get_user_setting( $name, $default );
$name(string) (required)
The name of the setting.
Default false.
Default: value to return when $name is not set


Since 2.7.0 Introduced.

Code of get_user_setting() WP 6.0

function get_user_setting( $name, $default = false ) {
	$all_user_settings = get_all_user_settings();

	return isset( $all_user_settings[ $name ] ) ? $all_user_settings[ $name ] : $default;