WordPress filter hook
woocommerce_order_details_status
Defined by WooCommerce and fired by 3 plugins in total, running on 7M+ sites between them.
“Filter to modify order detiails status text.”
How to use woocommerce_order_details_status
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_order_details_status', function( $sprintf, $order ) {
// Change $sprintf here.
return $sprintf;
}, 10, 2 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
3 plugins that fire woocommerce_order_details_status
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_order_details_status', sprintf( esc_html__( 'Order #%1$s was placed on %2$s and is currently %3$s.', 'woocommerce' ), '<mark class="order-number">' . $order->get_order_number() . '</mark>', '<mark class="order-date">' . wc_format_datetime( $order->get_date_created() ) . '</mark>', '<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>' ), $order )templates/myaccount/view-order.php:34 -
SysBasics Customize My Account for WooCommerce7,000+ installs
apply_filters( 'woocommerce_order_details_status', sprintf( esc_html__( 'Order #%1$s was placed on %2$s and is currently %3$s.', 'customize-my-account-for-woocommerce' ), '<mark class="order-number">' . $order->get_order_number() . '</mark>', '<mark class="order-date">' . wc_format_datetime( $order->get_date_created() ) . '</mark>', '<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>' ), $order )templates/myaccount/view-order/02.php:34 -
Donation Platform for WooCommerce: Fundraising & Donation Management6,000+ installs
apply_filters( 'woocommerce_order_details_status', sprintf( esc_html__( 'Donation #%1$s was placed on %2$s and is currently %3$s.', 'wc-donation-platform' ), '<mark class="order-number">' . $order->get_order_number() . '</mark>', '<mark class="order-date">' . wc_format_datetime( $order->get_date_created() ) . '</mark>', '<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>' ), $order )includes/wc-templates/myaccount/view-order.php:36
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.