WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#30852 closed defect (bug) (fixed)

Incorrect docs for `user_has_cap` filter

Reported by: dlh Owned by: wonderboymusic
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.8
Component: Role/Capability Keywords: has-patch
Focuses: docs Cc:
PR Number:

Description

The WP_User::allcaps property is "all capabilities the user has, including individual and role based," but the $allcaps parameter in the "user_has_cap" filter is documented as a role's capabilities. This patch updates the filter to match.

Attachments (1)

30852.patch (653 bytes) - added by dlh 5 years ago.

Download all attachments as: .zip

Change History (3)

@dlh
5 years ago

#1 @johnbillion
5 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.2
  • Summary changed from Inconsistent docs for `WP_User::allcaps` to Incorrect docs for `user_has_cap` filter
  • Version changed from trunk to 3.8

The allcaps property of the WP_User class does indeed represent all of the caps of the user, not the caps of the user's role. Introduced in r26126.

#2 @wonderboymusic
5 years ago

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

In 31013:

Fix docs for WP_User::allcaps:

The allcaps property of the WP_User class represents all of the caps of the user, not the caps of the user's role. Introduced in [26126].

Props dlh.
Fixes #30852.

Note: See TracTickets for help on using tickets.