Action
rpress_admin_order_after_tax_row
On this page
Fires in the admin order details totals, after the tax row and before the order total.
Runs on the order details screen in the dashboard, inside the order totals block. Core uses it to print the per-tax-class breakdown. The second argument is always the string 'admin', which lets a callback shared with the customer receipt know where it is rendering.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$payment_id | int | Order (payment) ID. |
$context | string | Always 'admin' for this call. |
Example#
add_action( 'rpress_admin_order_after_tax_row', 'my_admin_order_extra_row', 10, 2 );
function my_admin_order_extra_row( $payment_id, $context ) {
$tip = (float) get_post_meta( $payment_id, '_my_tip', true );
if ( $tip > 0 ) {
echo '<div><span>' . esc_html__( 'Tip', 'my-plugin' ) . '</span><strong>' . esc_html( rpress_format_amount( $tip ) ) . '</strong></div>';
}
}
Notes#
The tax classes feature hooks rpress_render_order_tax_breakdown() here with the same two arguments; it prints the breakdown rows when $context is 'admin'.
Source#
Fired from:
includes/admin/payments/view-order-details.php(line 1238)
See also#
Was this page helpful?
