X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0459461f9ea42e0b090759ff6fe5f48360bef750..refs/tags/wordpress-4.5:/wp-includes/capabilities.php?ds=sidebyside diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 7c570c4a..9ed3447e 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -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 */