]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/capabilities.php
WordPress 4.5
[autoinstalls/wordpress.git] / wp-includes / capabilities.php
index 7c570c4a1ddfb5a502bb8582c6a3f7c7683e51fc..9ed3447e6c83a9aaeb4bdea4bddd81bc4911a2aa 100644 (file)
@@ -16,6 +16,8 @@
  *
  * @since 2.0.0
  *
+ * @global array $post_type_meta_caps Used to get post type meta capabilities.
+ *
  * @param string $cap       Capability name.
  * @param int    $user_id   User ID.
  * @param int    $object_id Optional. ID of the specific object to check against if `$cap` is a "meta" cap.
@@ -377,7 +379,7 @@ function map_meta_cap( $cap, $user_id ) {
                break;
        default:
                // Handle meta capabilities for custom post types.
-               $post_type_meta_caps = _post_type_meta_capabilities();
+               global $post_type_meta_caps;
                if ( isset( $post_type_meta_caps[ $cap ] ) ) {
                        $args = array_merge( array( $post_type_meta_caps[ $cap ], $user_id ), $args );
                        return call_user_func_array( 'map_meta_cap', $args );
@@ -406,6 +408,8 @@ function map_meta_cap( $cap, $user_id ) {
  * While checking against particular roles in place of a capability is supported
  * in part, this practice is discouraged as it may produce unreliable results.
  *
+ * Note: Will always return true if the current user is a super admin, unless specifically denied.
+ *
  * @since 2.0.0
  *
  * @see WP_User::has_cap()
@@ -433,11 +437,11 @@ function current_user_can( $capability ) {
 }
 
 /**
- * Whether current user has a capability or role for a given blog.
+ * Whether current user has a capability or role for a given site.
  *
  * @since 3.0.0
  *
- * @param int $blog_id Blog ID
+ * @param int    $blog_id    Site ID.
  * @param string $capability Capability or role name.
  * @return bool
  */