Skip to content
Docs
Get RestroPress

Filter

rpress_check_new_orders_cap

Updated
On this page

Filters the capability required to poll for new orders.

Used by the check_new_orders AJAX handler that powers the new order notification in the admin. Users without the returned capability receive a 403 JSON error. The default is edit_shop_payments.

Parameters#

ParameterTypeDescription
$capabilitystringCapability name checked with current_user_can(). Default is edit_shop_payments.

Return value#

string. The capability required to check for new orders.

Example#

function my_check_new_orders_cap( $capability ) {
	return 'view_shop_reports';
}
add_filter( 'rpress_check_new_orders_cap', 'my_check_new_orders_cap' );

Source#

Applied in:

  • includes/class-rpress-ajax.php (line 1750), in RP_AJAX::check_new_orders()
Was this page helpful?