Filter
rpress_is_order_restorable
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#
| Parameter | Type | Description |
|---|---|---|
$is_restorable | bool | Whether the order can be restored. |
$payment | RPRESS_Payment | The 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), inrpress_is_order_restorable()
See also#
Was this page helpful?
