get_all_user_settings example

/** * Retrieves user interface setting value based on setting name. * * @since 2.7.0 * * @param string $name The name of the setting. * @param string|false $default_value Optional. 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. */
function get_user_setting( $name$default_value = false ) {
    $all_user_settings = get_all_user_settings();

    return isset( $all_user_settings[ $name ] ) ? $all_user_settings[ $name ] : $default_value;
}

/** * 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()`. * * @since 2.8.0 * * @param string $name The name of the setting. * @param string $value The value for the setting. * @return bool|null True if set successfully, false otherwise. * Null if the current user is not a member of the site. */
Home | Imprint | This part of the site doesn't use cookies.