Make WordPress Core

Ticket #42589: 42589.2.patch

File 42589.2.patch, 1.4 KB (added by mariovalney, 6 years ago)
  • wp-includes/capabilities.php

    diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php
    index c192639608..7fd4a0a29f 100644
    a b function author_can( $post, $capability ) { 
    705705/**
    706706 * Whether a particular user has a specific capability.
    707707 *
     708 * While checking against particular roles in place of a capability is supported
     709 * in part, this practice is discouraged as it may produce unreliable results.
     710 *
     711 * Note: Will always return true if the current user is a super admin, unless specifically denied.
     712 *
    708713 * @since 3.1.0
    709714 *
     715 * @see WP_User::has_cap()
     716 * @see map_meta_cap()
     717 *
    710718 * @param int|WP_User $user       User ID or object.
    711719 * @param string      $capability Capability name.
     720 * @param int         $object_id  Optional. ID of the specific object to check against if `$capability` is a "meta" cap.
     721 *                                "Meta" capabilities, e.g. 'edit_post', 'edit_user', etc., are capabilities used
     722 *                                by map_meta_cap() to map to other "primitive" capabilities, e.g. 'edit_posts',
     723 *                                'edit_others_posts', etc. Accessed via func_get_args() and passed to WP_User::has_cap(),
     724 *                                then map_meta_cap().
    712725 * @return bool Whether the user has the given capability.
    713726 */
    714727function user_can( $user, $capability ) {