Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#43410 closed defect (bug) (fixed)

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

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

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 9 years ago.
Patch

Download all attachments as: .zip

Change History (6)

#1 @thomaswm
9 years ago

  • Version → 2.7

Documentation was added in [8904].

#2 @SergeyBiryukov
9 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone Awaiting Review → 5.0

@thomaswm
9 years ago

Patch

#3 @thomaswm
9 years ago

  • Keywords has-patch added; needs-patch removed

#4 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 42735:

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

Props thomaswm.
Fixes #43410.

#5 @SergeyBiryukov
8 years ago

  • Milestone 5.0 → 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.