I need to rename "On Hold" to "Pending Approval" and "Processing" to "Approved", in every instance. (Btw, I'm a diy shop owner, not a developer)
This topic got me 60% there, Rename multiple order statuses in Woocommerce Now need to address these locations:
- admin > orders, the preview popup (eye symbol).
- front end > my-account/orders, the Status column.
- front end > my-account/view-order/x, the summary line.
My code:
add_filter( 'wc_order_statuses', 'rename_order_statuses', 20, 1 );
function rename_order_statuses( $order_statuses ) {
$order_statuses['wc-processing'] = _x( 'Approved', 'Order status', 'woocommerce' );
$order_statuses['wc-on-hold'] = _x( 'Pending Approval', 'Order status', 'woocommerce' );
return $order_statuses;
}
add_filter( 'bulk_actions-edit-shop_order', 'custom_dropdown_bulk_actions_shop_order', 20, 1 );
function custom_dropdown_bulk_actions_shop_order( $actions ) {
$actions['mark_processing'] = __( 'Mark Approved', 'woocommerce' );
$actions['mark_on-hold'] = __( 'Mark Pending Approval', 'woocommerce' );
return $actions;
}
foreach( array( 'post', 'shop_order' ) as $hook ) {
add_filter( "views_edit-$hook", 'shop_order_modified_views' );
}
function shop_order_modified_views( $views ){
if( isset( $views['wc-processing'] ) )
$views['wc-processing'] = str_replace( 'Processing', __( 'Approved', 'woocommerce'), $views['wc-processing'] );
if( isset( $views['wc-on-hold'] ) )
$views['wc-on-hold'] = str_replace( 'On hold', __( 'Pending Approval', 'woocommerce'), $views['wc-on-hold'] );
return $views;
}