Function: get_user_setting

get_user_setting( string $name, string $default )

Retrieve user interface setting value based on setting name.

Parameters

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.

Returns

mixed

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

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.