Docs: Clarify some terminology around meta capabilities, primitive capabilities, and roles.

See #41017

Built from https://develop.svn.wordpress.org/trunk@41366


git-svn-id: http://core.svn.wordpress.org/trunk@41199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2017-09-10 22:51:43 +00:00
parent f2a0b5267d
commit 152f5410ac
2 changed files with 11 additions and 12 deletions

View File

@ -672,27 +672,26 @@ class WP_User {
}
/**
* Whether user has capability or role name.
* Whether the user has a specific capability.
*
* While checking against particular roles in place of a capability is supported
* in part, this practice is discouraged as it may produce unreliable results.
* While checking against a role in place of a capability is supported in part, this practice is discouraged as it
* may produce unreliable results.
*
* @since 2.0.0
*
* @see map_meta_cap()
*
* @param string $cap Capability name.
* @param int $object_id,... Optional. ID of the specific object to check against if `$cap` is a "meta" cap.
* "Meta" capabilities, e.g. 'edit_post', 'edit_user', etc., are capabilities used
* by map_meta_cap() to map to other "primitive" capabilities, e.g. 'edit_posts',
* 'edit_others_posts', etc. The parameter is accessed via func_get_args() and passed
* to map_meta_cap().
* @return bool Whether the current user has the given capability. If `$cap` is a meta cap and `$object_id` is
* passed, whether the current user has the given meta capability for the given object.
* @param int $object_id,... Optional. ID of a specific object to check against if `$cap` is a "meta" capability.
* Meta capabilities such as `edit_post` and `edit_user` are capabilities used by
* by the `map_meta_cap()` function to map to primitive capabilities that a user or
* role has, such as `edit_posts` and `edit_others_posts`.
* @return bool Whether the user has the given capability, or, if `$object_id` is passed, whether the user has
* the given capability for that object.
*/
public function has_cap( $cap ) {
if ( is_numeric( $cap ) ) {
_deprecated_argument( __FUNCTION__, '2.0.0', __('Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.') );
_deprecated_argument( __FUNCTION__, '2.0.0', __( 'Usage of user levels is deprecated. Use capabilities instead.' ) );
$cap = $this->translate_level_to_cap( $cap );
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41365';
$wp_version = '4.9-alpha-41366';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.