WordPress.org

Make WordPress Core

#43026 closed defect (bug) (duplicate)

Deprecated feature still used in WP User Query.

Reported by: kennithnichol Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords:
Focuses: ui, administration Cc:

Description

Today we noticed that our Editor users were not listed in the "Authors" drop down on the post editor.

Looking at the wp_usermeta table revealed that Editors have the proper capabilities; however, their user_level was set to 0. Now, it is likely by accident that all editors were set to level_0. The point is that the Author drop down still relies on this deprecated feature to produce its list.

The code found in class-wp-user-query.php on line 323 clearly makes use of the user_level value.

$who_query = array(
        'key'     => $wpdb->get_blog_prefix( $blog_id ) . 'user_level',
        'value'   => 0,
        'compare' => '!=',
);

Shouldn't this be updated to use a user_role based filter, since that is the primary means by which user roles are assigned now?

Change History (1)

#1 @swissspidy
19 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version trunk deleted

Hey there,

We're already working on this in #16841. It's quite an old bug.

Note: See TracTickets for help on using tickets.