Skip to content
Docs
Get RestroPress

Filter

rpress_order_popup_enabled

Updated
On this page

Filters whether the new-order popup is switched on.

The default comes from the "New-order popup and sound on admin screens" setting (enable_order_notification). When true, users with the order alerts capability get the popup assets on admin screens, except where the Live Orders script is already loaded. Return false to stop it loading.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$enabledboolValue of the setting.

Return value#

bool. Whether the popup is on.

Example#

add_filter( 'rpress_order_popup_enabled', 'my_popup_enabled', 10, 1 );
function my_popup_enabled( $enabled ) {
	if ( current_user_can( 'manage_options' ) ) {
		return false;
	}
	return $enabled;
}

Source#

Applied in:

  • includes/features/order-alerts/popup.php (line 61), in RPRESS_Order_Popup::enabled()

See also#

Was this page helpful?