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

Retrieve user interface setting value based on setting name.

Description Description

Parameters Parameters


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


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

Default value: false

Top ↑

Return Return

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

Top ↑

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

Top ↑

Changelog Changelog

Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.