Docs: Correct description for `WP_User::get_role_caps()`.

Props thomaswm.
Fixes #43410.
Built from https://develop.svn.wordpress.org/trunk@42735


git-svn-id: http://core.svn.wordpress.org/trunk@42565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-02-25 15:39:30 +00:00
parent b6229650e0
commit 35d5163d66
2 changed files with 6 additions and 6 deletions

View File

@ -481,9 +481,9 @@ class WP_User {
* Retrieve all of the role capabilities and merge with individual capabilities. * Retrieve all of the role capabilities and merge with individual capabilities.
* *
* All of the capabilities of the roles the user belongs to are merged with * All of the capabilities of the roles the user belongs to are merged with
* the users individual roles. This also means that the user can be denied * user's individual capabilities. This also means that the user can be denied
* specific roles that their role might have, but the specific user isn't * specific capabilities that their role might have, but the user isn't granted
* granted permission to. * permission to.
* *
* @since 2.0.0 * @since 2.0.0
* *
@ -499,12 +499,12 @@ class WP_User {
$wp_roles = wp_roles(); $wp_roles = wp_roles();
//Filter out caps that are not role names and assign to $this->roles // Filter out caps that are not role names and assign to $this->roles.
if ( is_array( $this->caps ) ) { if ( is_array( $this->caps ) ) {
$this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) ); $this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) );
} }
//Build $allcaps from role caps, overlay user's $caps // Build $allcaps from role caps, overlay user's $caps.
$this->allcaps = array(); $this->allcaps = array();
foreach ( (array) $this->roles as $role ) { foreach ( (array) $this->roles as $role ) {
$the_role = $wp_roles->get_role( $role ); $the_role = $wp_roles->get_role( $role );

View File

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