W3cubDocs

/WordPress

get_user_setting( string $name, string $default = false )

Retrieves user interface setting value based on setting name.

Parameters

$name

(string) (Required) The name of the setting.

$default

(string) (Optional) default value to return when $name is not set.

Default value: false

Return

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

Source

File: wp-includes/option.php

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

Changelog

Version Description
2.7.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_user_setting