Skip to content
Docs
Get RestroPress

Filter

rpress_admin_order_preview_get_order_details

Updated
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#

ParameterTypeDescription
$detailsarrayAssociative array of order details passed to the preview template.
$paymentRPRESS_PaymentThe 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), in RPRESS_Payment_History_Table::order_preview_get_order_details()

See also#

Was this page helpful?