[wp-trac] [WordPress Trac] #32694: current_user_can function is able to take post_id as argument, but it is not documented in WordPress documentation.

WordPress Trac noreply at wordpress.org
Wed Sep 16 07:35:39 UTC 2015


#32694: current_user_can function is able to take post_id as argument, but it is
not documented in WordPress documentation.
--------------------------+---------------------------
 Reporter:  jliman        |       Owner:  DrewAPicture
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.4
Component:  General       |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:  docs
--------------------------+---------------------------
Changes (by DrewAPicture):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"34224"]:
 {{{
 #!CommitTicketReference repository="" revision="34224"
 Docs: Add documentation for `$object_id`, the optional second parameter in
 `current_user_can()` and `WP_User::has_cap()`, and the optional third
 parameter in `map_meta_cap()`.

 This change introduces the vernacular of "meta" vs "primitive"
 capabilities to core docs, and providing examples for each inline and
 attempts to make it clear that `$object_id` is really only useful if the
 passed `$capability` is of the meta cap variety.

 Props jliman for the initial patch.
 Fixes #32694.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32694#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list