Simplify the backend order list by hiding batch operations, except processing status filtering, which is effective.
P粉311563823
P粉311563823 2023-08-07 18:02:56
0
1
567
<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粉311563823
P粉311563823

reply all(1)
P粉482108310

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!