WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#37393 closed defect (bug) (invalid)

Is documentation summary for current_user_can() wrong?

Reported by: zorobabel Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.0
Component: Role/Capability Keywords:
Focuses: docs Cc:
PR Number:

Description

In wp-includes/capabilities.php, the function current_user_can() "has" an optional param called $object_id but it does not work appear in function's body.

Change History (3)

#1 @Clorith
3 years ago

  • Focuses docs added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version changed from trunk to 2.0

Hi there, and welcome to Trac!

You can actually pass an optional argument of $object_id here, you'll notice that there's a call to func_get_args which is used to get arguments, and then passed on to call_user_func_array.

So the docs are correct in stating that there is an optional 2nd argument.

#2 @zorobabel
3 years ago

@Clorith

Hi there, and welcome to Trac''

Thanks!

You can actually pass an optional argument of $object_id here, you'll notice that there's a call to func_get_args which is used to get arguments, and then passed on to call_user_func_array. So the docs are correct in stating that there is an optional 2nd argument.

I'm sorry, my bad, thanks for the clarification.

#3 @SergeyBiryukov
2 years ago

#41200 was marked as a duplicate.

Note: See TracTickets for help on using tickets.