search

Home  >  Q&A  >  body text

Simplify the backend order list by hiding batch operations, except processing status filtering, which is effective.

<p>Is there any way to hide bulk operations from the admin order list other than processing status filtered list: post_status=wc-processing, I only want to show bulk operations?<br /><br /> I tried using the code from How to remove bulk actions from the manage orders page, but that hides the bulk actions from all orders list. <br /><br />What I want is to display only batch operations with a filtered list of processing statuses. Will this work? help family</p><p><br /></p>
P粉311563823P粉311563823523 days ago633

reply all(1)I'll reply

  • P粉482108310

    P粉4821083102023-08-08 11:49:53

    Only use the following lines to display bulk operations in the order list with "Processing" status.

    add_filter( 'bulk_actions-edit-shop_order', 'bulk_actions_only_on_processing_orders_list', 100 );
    function bulk_actions_only_on_processing_orders_list( $bulk_actions ) {
        if( ! (isset($_GET['post_status']) && $_GET['post_status'] === 'wc-processing') ) {
            $bulk_actions = array();
        }
        return $bulk_actions;
    }

    The code is in the child theme’s functions.php file or plugin file. Very careful

    reply
    0
  • Cancelreply