Action
rpress_view_order_details_before
On this page
Fires near the top of the order details screen to output notices for the order.
The output is captured while the page is built and printed in the top alert area of the order screen after being passed through wp_kses_post(), so only post-allowed HTML is kept.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$payment_id | int | The order (payment) ID. |
Example#
function my_order_details_notice( $payment_id ) {
if ( get_post_meta( $payment_id, 'my_flagged', true ) ) {
echo '<div class="notice notice-warning inline"><p>' . esc_html__( 'This order is flagged.', 'my-plugin' ) . '</p></div>';
}
}
add_action( 'rpress_view_order_details_before', 'my_order_details_notice' );
Notes#
Output is buffered, so scripts and form fields are stripped by wp_kses_post().
Source#
Fired from:
includes/admin/payments/view-order-details.php(line 189)
See also#
Was this page helpful?
