API / Minn\Runtime / UserOrder

UserOrder final class

Minn\Runtime\UserOrder · public/minn/src/Minn/Runtime/UserOrder.php · 43 lines

A user query's ORDER BY keys as the reference writes them (probe wp-user-query-sql): the user columns by their short or full names, the display name, a post count (its subquery joined in), the id, the meta key or meta value, the order include or a name list gives, or a named meta clause; '' for a key it does not know.

Constants and properties

privateSHORT = array ( 0 => 'login', 1 => 'nicename', 2 => 'email', 3 => 'url', 4 => 'registered', )
privateFULL = array ( 0 => 'user_login', 1 => 'user_nicename', 2 => 'user_email', 3 => 'user_url', 4 => 'user_registered', )

Public

staticdirection(mixed $order): string#

ASC when asked for, DESC for anything else.

staticclause(WP_User_Query $query, string $orderby, object $wpdb): string#

The column or expression one orderby key stands for.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatepostCount(WP_User_Query $query, object $wpdb): string#

Joins each author's published post count in, and orders by it.