Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#43410 closed defect (bug) (fixed)

Docs of WP_User::get_role_caps() mix up roles and capabilities

Reported by: thomaswm's profile thomaswm Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: normal Version: 2.7
Component: Users Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

The documentation of the WP_User member function get_role_caps() is as follows:

All of the capabilities of the roles the user belongs to are merged with the users individual roles. This also means that the user can be denied specific roles that their role might have, but the specific user isn’t granted permission to.

This documentation seems confusing to me. I think that roles and capabilities are mixed up in two places:

All of the capabilities of the roles the user belongs to are merged with the user's individual roles capabilities. This also means that the user can be denied specific roles capabilities that their role might have, but the specific user isn’t granted permission to.

Attachments (1)

43410.diff (763 bytes) - added by thomaswm 7 years ago.
Patch

Download all attachments as: .zip

Change History (6)

#1 @thomaswm
7 years ago

  • Version set to 2.7

Documentation was added in [8904].

#2 @SergeyBiryukov
7 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 5.0

@thomaswm
7 years ago

Patch

#3 @thomaswm
7 years ago

  • Keywords has-patch added; needs-patch removed

#4 @SergeyBiryukov
7 years ago

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

In 42735:

Docs: Correct description for WP_User::get_role_caps().

Props thomaswm.
Fixes #43410.

#5 @SergeyBiryukov
6 years ago

  • Milestone changed from 5.0 to 5.1

Switching milestone due to the focus on the new editor (Gutenberg) for WordPress 5.0.

Note: See TracTickets for help on using tickets.