Skip to content
Docs
Get RestroPress

Filter

rpress_is_order_restorable

Updated
On this page

Filters whether an order can be restored from the trash.

Runs at the end of rpress_is_order_restorable() with true when the payment status is trash. Return false to prevent restoring an order.

Parameters#

ParameterTypeDescription
$is_restorableboolWhether the order can be restored.
$paymentRPRESS_PaymentThe payment object for the order.

Return value#

bool. True if the order can be restored.

Example#

function my_is_order_restorable( $is_restorable, $payment ) {
	return $is_restorable && current_user_can( 'manage_shop_settings' );
}
add_filter( 'rpress_is_order_restorable', 'my_is_order_restorable', 10, 2 );

Notes#

The result is cast to bool. It is not called when the payment cannot be loaded.

Source#

Applied in:

  • includes/admin/orders/actions.php (line 329), in rpress_is_order_restorable()

See also#

Was this page helpful?