public function total(array $args = []): int
    {
        // Establish args.

        $default_args = [
            // Also used by {@link all()}.
            'filters'  => [],
            'no_cache' => false,
        ];
        $args = array_merge($default_args, $args);
        $args = array_intersect_key($args, $default_args);

        $args['filters']  = (array) $args['filters'];
        $args['no_cache'] = (bool) $args['no_cache'];

        // Check cache; already did this query?

        $cache_keys = $args; // Keys to consider when checking the cache.
        unset($cache_keys['no_cache']); // Cache key exclusions.

        if (($total = &$this->cacheKey(__FUNCTION__, $cache_keys)) !== null && !$args['no_cache']) {
            return $total; // Already cached this.
        }
        // Establish total users in the query.

        $WP_User_Query = new \WP_User_Query(array_merge($args['filters'], [
            'fields' => 'ID', 'offset' => 0, 'paged' => 1, 'number' => 1, 'count_total' => true,
        ]));
        return $total = (int) $WP_User_Query->get_total();
    }
public function total(array $args = []): int
    {
        // Establish args.

        $default_args = [
            // Also used by {@link all()}.
            'filters'  => [],
            'no_cache' => false,
        ];
        $args = array_merge($default_args, $args);
        $args = array_intersect_key($args, $default_args);

        $args['filters']  = (array) $args['filters'];
        $args['no_cache'] = (bool) $args['no_cache'];

        // Check cache; already did this query?

        $cache_keys = $args; // Keys to consider when checking the cache.
        unset($cache_keys['no_cache']); // Cache key exclusions.

        if (($total = &$this->cacheKey(__FUNCTION__, $cache_keys)) !== null && !$args['no_cache']) {
            return $total; // Already cached this.
        }
        // Establish total users in the query.

        $WP_User_Query = new \WP_User_Query(array_merge($args['filters'], [
            'fields' => 'ID', 'offset' => 0, 'paged' => 1, 'number' => 1, 'count_total' => true,
        ]));
        return $total = (int) $WP_User_Query->get_total();
    }
public function total ( array $ args = [ ] ) : int { // Establish args. $ default_args = [ // Also used by {@link all()}. 'filters' => [ ] , 'no_cache' => false , ] ; $ args = array_merge ( $ default_args , $ args ) ; $ args = array_intersect_key ( $ args , $ default_args ) ; $ args [ 'filters' ] = ( array ) $ args [ 'filters' ] ; $ args [ 'no_cache' ] = ( bool ) $ args [ 'no_cache' ] ; // Check cache; already did this query? $ cache_keys = $ args ; // Keys to consider when checking the cache. unset ( $ cache_keys [ 'no_cache' ] ) ; // Cache key exclusions. if ( ( $ total = & $ this -> cacheKey ( __FUNCTION__ , $ cache_keys ) ) !== null && ! $ args [ 'no_cache' ] ) { return $ total ; // Already cached this. } // Establish total users in the query. $ WP_User_Query = new \ WP_User_Query ( array_merge ( $ args [ 'filters' ] , [ 'fields' => 'ID' , 'offset' => 0 , 'paged' => 1 , 'number' => 1 , 'count_total' => true , ] ) ) ; return $ total = ( int ) $ WP_User_Query -> get_total ( ) ; }
Total users.

@since 160524 User utils.

@param array $args Behavioral args.

@return int Total users.
Total users .