Automattic\WooCommerce\Internal\POS

Capabilities::pos_staff_user_query_args │ public static │ WC 11.0.0

WP_User_Query args selecting candidate POS staff — every user holding any woocommerce_pos_* capability, via WP_User_Query's capability__in.

Use it to enumerate POS staff — e.g. the GET /wc/pos/v1/staff endpoint and the wp-admin Staff list — which refine the candidates for their own needs (the staff endpoint also requires a PIN). Keying on caps rather than the preset meta keeps this aligned with the authorization signal: a user whose caps were stripped is excluded, and a cap granted outside a preset is still included.

This is a candidate query, not exact parity with has_pos_access(): capability__in matches the capability name wherever it appears in the serialized capabilities row, so a user with an explicit denial (add_cap( $cap, false )) is still selected even though has_pos_access() — which reads the resolved capabilities — treats them as no access. Capabilities only ever grants or strips caps, never denies, so this diverges only when external code sets an explicit denial; callers needing exact parity should refine results with has_pos_access().

Method of the class: Capabilities{}

No Hooks.

Returns

array<string, mixed>.

Usage

$result = Capabilities::pos_staff_user_query_args(): array;

Changelog

Since 11.0.0 Introduced.

Capabilities::pos_staff_user_query_args() code WC 11.1.2

public static function pos_staff_user_query_args(): array {
	return array(
		'capability__in' => self::all_pos_capabilities(),
	);
}