mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Create a function, wp_roles(), to DRY the inline instantiation of the $wp_roles global.
Add missing doc blocks for `capabilities.php`. See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32541 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1334,7 +1334,7 @@ function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {
|
||||
* @return array Includes a grand total and an array of counts indexed by role strings.
|
||||
*/
|
||||
function count_users($strategy = 'time') {
|
||||
global $wpdb, $wp_roles;
|
||||
global $wpdb;
|
||||
|
||||
// Initialize
|
||||
$id = get_current_blog_id();
|
||||
@@ -1342,12 +1342,7 @@ function count_users($strategy = 'time') {
|
||||
$result = array();
|
||||
|
||||
if ( 'time' == $strategy ) {
|
||||
global $wp_roles;
|
||||
|
||||
if ( ! isset( $wp_roles ) )
|
||||
$wp_roles = new WP_Roles();
|
||||
|
||||
$avail_roles = $wp_roles->get_names();
|
||||
$avail_roles = wp_roles()->get_names();
|
||||
|
||||
// Build a CPU-intensive query that will return concise information.
|
||||
$select_count = array();
|
||||
|
||||
Reference in New Issue
Block a user