WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

set_user_setting() WP 2.8.0

Adds or updates user interface setting.

Both $name and $value can contain only ASCII letters, numbers, hyphens, and underscores.

This function has to be used before any output has started as it calls setcookie().

Хуков нет.

Возвращает

true/false/null. True if set successfully, false otherwise. Null if the current user is not a member of the site.

Использование

set_user_setting( $name, $value );
$name(строка) (обязательный)
The name of the setting.
$value(строка) (обязательный)
The value for the setting.

Список изменений

С версии 2.8.0 Введена.

Код set_user_setting() WP 5.5.1

wp-includes/option.php
<?php
function set_user_setting( $name, $value ) {
	if ( headers_sent() ) {
		return false;
	}

	$all_user_settings          = get_all_user_settings();
	$all_user_settings[ $name ] = $value;

	return wp_set_all_user_settings( $all_user_settings );
}