Last active
May 28, 2021 17:10
-
-
Save jamesgol/ac15afd39453fbee4367e5ac4c7c16ba to your computer and use it in GitHub Desktop.
Append post_status to WooCommerce orders menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'admin_init', 'woo_set_order_menu_default' ); | |
function woo_set_order_menu_default() { | |
global $submenu; | |
$original_menu = 'edit.php?post_type=shop_order'; | |
foreach ( $submenu['woocommerce'] as $id => &$menu ) { | |
if ( $menu[2] === $original_menu ) { | |
// Append post_status only to WooCommerce orders page | |
$menu[2] = $original_menu . '&post_status=wc-processing'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment