WordPress.org

Make WordPress Core

Opened 22 months ago

Closed 22 months ago

Last modified 14 months ago

#43410 closed defect (bug) (fixed)

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

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

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 22 months ago.
Patch

Download all attachments as: .zip

Change History (6)

#1 @thomaswm
22 months ago

  • Version set to 2.7

Documentation was added in [8904].

#2 @SergeyBiryukov
22 months ago

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

@thomaswm
22 months ago

Patch

#3 @thomaswm
22 months ago

  • Keywords has-patch added; needs-patch removed

#4 @SergeyBiryukov
22 months 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
14 months 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.