get_user_setting( string $name, string|false $default_value = false ): mixed

In this article

Retrieves user interface setting value based on setting name.

Parameters

$namestringrequired
The name of the setting.
$default_valuestring|falseoptional
Default value to return when $name is not set.

Default:false

Return

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

Source


// The cookie is newer than the saved value. Update the user_option and leave the cookie as-is.
if ( $current > $last_saved ) {
	update_user_option( $user_id, 'user-settings', $cookie, false );
	update_user_option( $user_id, 'user-settings-time', time() - 5, false );

Changelog

VersionDescription
2.7.0Introduced.

User Contributed Notes

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