API / Minn\Runtime / UserCounts

UserCounts final class

Minn\Runtime\UserCounts · public/minn/src/Minn/Runtime/UserCounts.php · 75 lines

The user counts WordPress's user functions give: how many users hold each role (count_users), and how many posts several users wrote (count_many_users_posts), as the reference was measured counting them (probes user-remaining, taxonomy-blocks-user-doubts).

Public

staticusers(mixed $strategy = 'time', mixed $siteId = NULL): mixed#

How many users there are and how many hold each role (count_users). Only a user with a capabilities row counts; "none" is a user whose row names nothing. The time strategy lists the registered roles that have users, in their registered order, then none; any other strategy lists none first, then every role a row names (registered or not), as met user by user. pre_count_users may answer first.

staticmanyUsersPosts(mixed $users, mixed $postType = 'post', mixed $publicOnly = false): mixed#

Post counts for several users (count_many_users_posts), as stored, 0 for none: published posts, and private ones too unless public only, the viewer's own or every author's for a viewer who may read the type's private posts. pre_count_many_users_posts may answer first.

@return array<int|string, int|string>