Make WordPress Core


Ignore:
Timestamp:
05/22/2015 04:46:36 AM (11 years ago)
Author:
wonderboymusic
Message:

Create a function, wp_roles(), to DRY the inline instantiation of the $wp_roles global.

Add missing doc blocks for capabilities.php.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r32524 r32541  
    13351335 */
    13361336function count_users($strategy = 'time') {
    1337     global $wpdb, $wp_roles;
     1337    global $wpdb;
    13381338
    13391339    // Initialize
     
    13431343
    13441344    if ( 'time' == $strategy ) {
    1345         global $wp_roles;
    1346 
    1347         if ( ! isset( $wp_roles ) )
    1348             $wp_roles = new WP_Roles();
    1349 
    1350         $avail_roles = $wp_roles->get_names();
     1345        $avail_roles = wp_roles()->get_names();
    13511346
    13521347        // Build a CPU-intensive query that will return concise information.
Note: See TracChangeset for help on using the changeset viewer.