Opened 10 years ago
Closed 10 years ago
#32694 closed defect (bug) (fixed)
current_user_can function is able to take post_id as argument, but it is not documented in WordPress documentation.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
The function current_user_can is documented with one parameter, but if we look at the code, it actually support post_id as the argument.
Attachments (3)
Change History (10)
#2
@
10 years ago
- Focuses docs added
- Keywords needs-patch added
- Version 4.2.1 deleted
Yeah, we're pretty bad about documenting functions that leverage func_get_args()
for variable numbers of arguments.
I distinctly remember being frustrated by the lack of documentation on add_query_arg()
, for instance, so I added some parameter docs there. We should probably do an audit and actually try to document any of these "variable-argument" functions in core.
#3
@
10 years ago
- Milestone changed from Awaiting Review to 4.4
I would like to get this done in 4.4, along with better docs for add_query_arg()
and others.
@jliman, are you interested in trying your hand at submitting a patch?
Note: See
TracTickets for help on using
tickets.
In other areas we've documented it as such (
WP_User::has_cap()
is what current_user_can() wraps)https://developer.wordpress.org/reference/classes/wp_user/has_cap/