Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#19265 closed defect (bug) (fixed)

WP_User user_level property doesn't exist any more

Reported by: duck_ Owned by: duck_
Milestone: 3.3 Priority: high
Severity: major Version: 3.3
Component: General Keywords: has-patch
Focuses: Cc:


[18597] for #15458 removed _fill_single_user() which had the following piece of code to set up user_level from $wpdb->prefix . 'user_level':

$level = $wpdb->prefix . 'user_level'; 
if ( isset( $user->{$level} ) ) 
    $user->user_level = $user->{$level}; 

This mapping no longer exists so $user->user_level yields an empty string.

This also means that the $user_level global isn't set correctly.

See report at http://wordpress.org/support/topic/get_currentuserinfo-alternative-in-33-beta-3.

Attachments (3)

19265.tests.diff (809 bytes) - added by duck_ 10 years ago.
19265.diff (943 bytes) - added by duck_ 10 years ago.
19265.2.diff (1.1 KB) - added by duck_ 10 years ago.

Download all attachments as: .zip

Change History (8)

10 years ago

#1 @duck_
10 years ago

  • Keywords needs-unit-tests removed

10 years ago

#2 follow-up: @duck_
10 years ago

  • Keywords has-patch added

Also wp_usersettings and wp_usersettingstime. I could only find one plugin, Your friendly "Current User Data" Deamon, using these two.

#3 in reply to: ↑ 2 @duck_
10 years ago

Replying to duck_:

Also wp_usersettings and wp_usersettingstime.

Forgot about the using the database prefix for the key, i.e. $prefix_usersettings and $prefix_usersettingstime

10 years ago

#4 @ryan
10 years ago

Looks good.

#5 @duck_
10 years ago

  • Owner set to duck_
  • Resolution set to fixed
  • Status changed from new to closed

In [19325]:

Provide back compat mapping for user_level, wp_usersettings and wp_usersettingstime properties of WP_User objects. Fixes #19265.

Note: See TracTickets for help on using tickets.