Function: get_user_setting

get_user_setting( string $name, string $default )

Retrieve user interface setting value based on setting name.

Shortcut: gus

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.


Name Type(s) Default Value Description
$name string

The name of the setting.

$default string false

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



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

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.