From 80bac8fe092772a1b42790e0776e8a355f96ff43 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 2 Oct 2013 21:36:09 +0000 Subject: [PATCH] `WP_User::get_role_caps()` now returns the caps it was already setting. The method was previously just setting `$allprops` and requiring that property to be read. Props nofearinc. Fixes #24962. Built from https://develop.svn.wordpress.org/trunk@25673 git-svn-id: http://core.svn.wordpress.org/trunk@25589 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/capabilities.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 9a9874ceeb..789a9dd197 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -732,6 +732,8 @@ class WP_User { * @since 2.0.0 * @uses $wp_roles * @access public + * + * @return array List of all capabilities for the user. */ function get_role_caps() { global $wp_roles; @@ -750,6 +752,8 @@ class WP_User { $this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities ); } $this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps ); + + return $this->allcaps; } /**