Make WordPress Core


Ignore:
Timestamp:
01/07/2010 12:01:52 AM (14 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r12511 r12616  
    215215 * @param string $option User option name.
    216216 * @param int $user Optional. User ID.
    217  * @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.
     217 * @param bool $deprecated Use get_option() to check for an option in the options table.
    218218 * @return mixed
    219219 */
    220 function get_user_option( $option, $user = 0, $check_blog_options = true ) {
    221     global $wpdb;
     220function get_user_option( $option, $user = 0, $deprecated = '' ) {
     221    global $wpdb;
     222
     223    if ( !empty( $deprecated ) )
     224        _deprecated_argument( __FUNCTION__, '3.0' );
    222225
    223226    $option = preg_replace('|[^a-z0-9_]|i', '', $option);
     
    231234    elseif ( isset( $user->{$option} ) ) // User specific and cross-blog
    232235        $result = $user->{$option};
    233     elseif ( $check_blog_options ) // Blog global
    234         $result = get_option( $option );
    235236    else
    236237        $result = false;
Note: See TracChangeset for help on using the changeset viewer.