Filter
rpress_payment_details_transaction_id-{$gateway}
On this page
Filters a gateway's transaction ID as displayed on the order details screen.
The dynamic part of the name is the order's gateway slug. Gateways use it to format their transaction ID, for example to turn it into a reference with a prefix. The result is escaped with esc_html() before it is printed, so HTML is not rendered.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$transaction_id | string | The transaction ID stored on the payment (already escaped with esc_attr()). |
$payment_id | int | The order (payment) ID. |
Return value#
string. The text to show as the transaction ID.
Example#
function my_format_transaction_id( $transaction_id, $payment_id ) {
return 'TX-' . $transaction_id;
}
add_filter( 'rpress_payment_details_transaction_id-my_gateway', 'my_format_transaction_id', 10, 2 );
Notes#
Only applied when a transaction ID exists. Used in two places on the screen, so the formatting appears in both. RestroPress registers callbacks for the paypal and stripe gateways.
Source#
Applied in:
includes/admin/payments/view-order-details.php(line 583)includes/admin/payments/view-order-details.php(line 638)
Was this page helpful?
