Deprecate argument. Never fallback to options table for user option requests. Props nacin. fixes #11615

git-svn-id: https://develop.svn.wordpress.org/trunk@12616 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-07 00:01:52 +00:00
parent e7003d6c95
commit dfe2e39c2c
10 changed files with 20 additions and 19 deletions
+2 -2
View File
@@ -770,7 +770,7 @@ function wp_user_settings() {
if ( ! $user = wp_get_current_user() )
return;
$settings = get_user_option( 'user-settings', $user->ID, false );
$settings = get_user_option( 'user-settings', $user->ID );
if ( isset( $_COOKIE['wp-settings-' . $user->ID] ) ) {
$cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-' . $user->ID] );
@@ -779,7 +779,7 @@ function wp_user_settings() {
if ( $cookie == $settings )
return;
$last_time = (int) get_user_option( 'user-settings-time', $user->ID, false );
$last_time = (int) get_user_option( 'user-settings-time', $user->ID );
$saved = isset( $_COOKIE['wp-settings-time-' . $user->ID]) ? preg_replace( '/[^0-9]/', '', $_COOKIE['wp-settings-time-' . $user->ID] ) : 0;
if ( $saved > $last_time ) {
+5 -4
View File
@@ -214,12 +214,15 @@ function user_pass_ok($user_login, $user_pass) {
*
* @param string $option User option name.
* @param int $user Optional. User ID.
* @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.
* @param bool $deprecated Use get_option() to check for an option in the options table.
* @return mixed
*/
function get_user_option( $option, $user = 0, $check_blog_options = true ) {
function get_user_option( $option, $user = 0, $deprecated = '' ) {
global $wpdb;
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '3.0' );
$option = preg_replace('|[^a-z0-9_]|i', '', $option);
if ( empty($user) )
$user = wp_get_current_user();
@@ -230,8 +233,6 @@ function get_user_option( $option, $user = 0, $check_blog_options = true ) {
$result = $user->{$wpdb->prefix . $option};
elseif ( isset( $user->{$option} ) ) // User specific and cross-blog
$result = $user->{$option};
elseif ( $check_blog_options ) // Blog global
$result = get_option( $option );
else
$result = false;