Filter
rpress_order_status_model
On this page
Filters the canonical order status model used by the tracker and admin dropdowns.
Runs at the end of rpress_order_status_model(). Each key is an order status slug and each value is an array with 'phase' (tracking phase), 'services' (service types the status applies to, 'delivery' and/or 'pickup') and 'order' (position in the sequence; 99 for cancelled). The back-compat aliases out_for_delivery, failed and refunded are already folded in before the filter runs. The model is read by the receipt tracker and by rpress_order_status_step_index().
Parameters#
| Parameter | Type | Description |
|---|---|---|
$model | array | Status slug => array( 'phase', 'services', 'order' ). |
Return value#
array. The status model.
Example#
add_filter( 'rpress_order_status_model', 'my_add_packed_status', 10, 1 );
function my_add_packed_status( $model ) {
$model['packed'] = array(
'phase' => 'ready',
'services' => array( 'delivery', 'pickup' ),
'order' => 3,
);
return $model;
}
Notes#
A custom status also needs a label (rpress_order_statuses) and, to appear in the tracker, a step (rpress_order_tracker_steps).
Source#
Applied in:
includes/payments/functions.php(line 946), inrpress_order_status_model()
See also#
Was this page helpful?
