Opened 11 years ago
Closed 11 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: | jliman | Owned by: | DrewAPicture |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | docs |
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
@
11 years ago
- Focuses docs added
- Keywords needs-patch added
- Version 4.2.1
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
@
11 years ago
- Milestone Awaiting Review → 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?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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/