WC_Tracker::get_user_counts() – Get user totals based on user role.

You appear to be a bot. Output may be restricted

Description

Get user totals based on user role.

Usage

$array = WC_Tracker::get_user_counts();

Parameters

Returns

array

Source

File name: woocommerce/includes/class-wc-tracker.php
Lines:

1 to 12 of 12
  private static function get_user_counts() {
    $user_count          = array();
    $user_count_data     = count_users();
    $user_count['total'] = $user_count_data['total_users'];

    // Get user count based on user role.
    foreach ( $user_count_data['avail_roles'] as $role => $count ) {
      $user_count[ $role ] = $count;
    }

    return $user_count;
  }
 

 View on GitHub View on Trac