WordPress.org

Make WordPress Core

Changeset 41322


Ignore:
Timestamp:
08/29/2017 04:42:55 PM (2 years ago)
Author:
johnbillion
Message:

Docs: Clarify descriptions and parameter types for various user capability checking functions.

See #41017

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r41290 r41322  
    566566
    567567/**
    568  * Whether current user has a capability or role for a given site.
     568 * Whether the current user has a specific capability for a given site.
    569569 *
    570570 * @since 3.0.0
    571571 *
    572572 * @param int    $blog_id    Site ID.
    573  * @param string $capability Capability or role name.
    574  * @return bool
     573 * @param string $capability Capability name.
     574 * @return bool Whether the user has the given capability.
    575575 */
    576576function current_user_can_for_blog( $blog_id, $capability ) {
     
    599599
    600600/**
    601  * Whether author of supplied post has capability or role.
     601 * Whether the author of the supplied post has a specific capability.
    602602 *
    603603 * @since 2.9.0
    604604 *
    605  * @param int|object $post Post ID or post object.
    606  * @param string $capability Capability or role name.
    607  * @return bool
     605 * @param int|WP_Post $post      Post ID or post object.
     606 * @param string      $capability Capability name.
     607 * @return bool Whether the post author has the given capability.
    608608 */
    609609function author_can( $post, $capability ) {
     
    623623
    624624/**
    625  * Whether a particular user has capability or role.
     625 * Whether a particular user has a specific capability.
    626626 *
    627627 * @since 3.1.0
    628628 *
    629  * @param int|object $user User ID or object.
    630  * @param string $capability Capability or role name.
    631  * @return bool
     629 * @param int|WP_User $user      User ID or object.
     630 * @param string      $capability Capability name.
     631 * @return bool Whether the user has the given capability.
    632632 */
    633633function user_can( $user, $capability ) {
Note: See TracChangeset for help on using the changeset viewer.