Make wp_user_settings() options global again. Clarify flag on get_user_option().

git-svn-id: http://svn.automattic.com/wordpress/trunk@10095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-12-07 03:53:28 +00:00
parent 5fec33de25
commit 3897eef6c9
2 changed files with 5 additions and 5 deletions

View File

@ -688,8 +688,8 @@ function wp_user_settings() {
$saved = isset( $_COOKIE['wp-settings-time-' . $user->ID]) ? preg_replace( '/[^0-9]/', '', $_COOKIE['wp-settings-time-' . $user->ID] ) : 0; $saved = isset( $_COOKIE['wp-settings-time-' . $user->ID]) ? preg_replace( '/[^0-9]/', '', $_COOKIE['wp-settings-time-' . $user->ID] ) : 0;
if ( $saved > $last_time ) { if ( $saved > $last_time ) {
update_user_option( $user->ID, 'user-settings', $cookie, false ); update_user_option( $user->ID, 'user-settings', $cookie, true );
update_user_option( $user->ID, 'user-settings-time', time() - 5, false ); update_user_option( $user->ID, 'user-settings-time', time() - 5, true );
return; return;
} }
} }

View File

@ -168,10 +168,10 @@ function user_pass_ok($user_login, $user_pass) {
* *
* @param string $option User option name. * @param string $option User option name.
* @param int $user Optional. User ID. * @param int $user Optional. User ID.
* @param bool $check_global Whether to check for a global option if a per-user option does not exist. Default is true. * @param bool $check_blog_options Whether to check for an option in the options table if a per-user option does not exist. Default is true.
* @return mixed * @return mixed
*/ */
function get_user_option( $option, $user = 0, $check_global = true ) { function get_user_option( $option, $user = 0, $check_blog_options = true ) {
global $wpdb; global $wpdb;
$option = preg_replace('|[^a-z0-9_]|i', '', $option); $option = preg_replace('|[^a-z0-9_]|i', '', $option);
@ -184,7 +184,7 @@ function get_user_option( $option, $user = 0, $check_global = true ) {
$result = $user->{$wpdb->prefix . $option}; $result = $user->{$wpdb->prefix . $option};
elseif ( isset( $user->{$option} ) ) // User specific and cross-blog elseif ( isset( $user->{$option} ) ) // User specific and cross-blog
$result = $user->{$option}; $result = $user->{$option};
elseif ( $check_global ) // Blog global elseif ( $check_blog_options ) // Blog global
$result = get_option( $option ); $result = get_option( $option );
else else
$result = false; $result = false;