How To Keep Container Shipments Update Checkbox Checked Always

Paste this code on your active theme’s functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
add_action('wp_footer', function(){
    // this is to make sure that the script only applies on containers page
    if(isset($_GET['wpcsc']) && ($_GET['wpcsc'] === 'edit' || $_GET['wpcsc'] === 'add')){
        ?>
            <script>
                jQuery(document).ready(function($){
                   $('#wpcscapply-shipment').attr('checked', true);
                   $('#wpcscapply-shipment').trigger('change');
                });
           </script>
        <?php
    }
});