Skip to content

Instantly share code, notes, and snippets.

@jamesgol
Last active May 28, 2021 17:10
Show Gist options
  • Save jamesgol/ac15afd39453fbee4367e5ac4c7c16ba to your computer and use it in GitHub Desktop.
Save jamesgol/ac15afd39453fbee4367e5ac4c7c16ba to your computer and use it in GitHub Desktop.
Append post_status to WooCommerce orders menu
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