関数 set_user_setting()
定義ファイル :/blog/wp-includes/option.php 4
set_user_setting()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /** * Add or update user interface setting. * * Both $name and $value can contain only ASCII letters, numbers 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 true if set successfully/false if not. */ 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 ); } |