Filter
rpress_admin_order_preview_get_order_details
On this page
Filters the order data sent to the order preview modal.
Builds the array returned by the AJAX order preview request, including id, service type and date, status, customer details, item HTML and actions HTML. Add keys to make extra data available to the preview template.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$details | array | Associative array of order details passed to the preview template. |
$payment | RPRESS_Payment | The payment object being previewed. |
Return value#
array. The order details array.
Example#
function my_order_preview_details( $details, $payment ) {
$details['my_source'] = get_post_meta( $payment->ID, 'my_source', true );
return $details;
}
add_filter( 'rpress_admin_order_preview_get_order_details', 'my_order_preview_details', 10, 2 );
Notes#
The array is sent to JavaScript as JSON and read by the underscore template. Extra keys are only visible if the preview template reads them, for example markup added with rpress_admin_order_preview_end.
Source#
Applied in:
includes/admin/payments/class-payments-table.php(line 2840), inRPRESS_Payment_History_Table::order_preview_get_order_details()
See also#
Was this page helpful?
