WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 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:

Description

[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_ 4 years ago.
19265.diff (943 bytes) - added by duck_ 4 years ago.
19265.2.diff (1.1 KB) - added by duck_ 4 years ago.

Download all attachments as: .zip

Change History (8)

@duck_4 years ago

comment:1 @duck_4 years ago

  • Keywords needs-unit-tests removed

@duck_4 years ago

comment:2 follow-up: @duck_4 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.

comment:3 in reply to: ↑ 2 @duck_4 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

@duck_4 years ago

comment:4 @ryan4 years ago

Looks good.

comment:5 @duck_4 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.