Automattic\WooCommerce\Api\Infrastructure

Principal::can_use_debug_modepublicWC 1.0

Whether this principal may activate GraphQL debug mode on the endpoint.

Implementing can_use_debug_mode() is opt-in for plugin principal classes, a principal that doesn't define it is denied by default. Plugins building authenticated endpoints should make an explicit decision per principal model rather than inheriting a debug mode policy by accident.

Note that this method's outcome is necessary but not sufficient for debug mode to be active: the controller also requires the request to carry _debug=1. The decision can be overridden by the woocommerce_graphql_can_use_debug_mode

Метод класса: Principal{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Principal = new Principal();
$Principal->can_use_debug_mode(): bool;

Код Principal::can_use_debug_mode() WC 11.0.1

public function can_use_debug_mode(): bool {
	return user_can( $this->user, 'manage_options' );
}