title: Change Status of Order to Confirmed without Sending Confirmation Email when Updating Via Custom Bulk Action Handler
body: <p>Need a bulk status update to Orders to change from On Hold to Completed but without sending confirmation emails. However, still need to retain the email functionality. This would be a new custom bulk action in addition to the standard WooCommerce bulk action to update to Completed (which <strong>still would</strong> send the confirmation emails). I have the extra option added with no problem but can't find a method that will preclude the email notification or a way to temporarily disable email notifications (which doesn't sound like a good approach anyway). </p>
  
  <p>So far code is as below. Everything is fine except the $order->update_status('completed') triggers the confirmation email. </p>
  
  <p>Have tried using set_status() but that produces the same result (update_status calls set_status). </p>
  
  <pre class="lang-php prettyprint-override"><code>/*
   * Custom bulk action in dropdown - Change status to completed without sending Confirmation Email
   */
  add_filter( 'bulk_actions-edit-shop_order', 'register_bulk_action' ); // edit-shop_order is the screen ID of the orders page
  
  function register_bulk_action( $bulk_actions ) {
  
      $bulk_actions['complete_with_no_email'] = 'Change status to completed (no confirmation emails)'; 
      return $bulk_actions;
  
  }
  
  /*
   * Bulk action handler
   */
  add_action( 'admin_action_complete_with_no_email', 'bulk_process_custom_status' ); // admin_action_{action name}
  
  function bulk_process_custom_status() {
  
      // if an array with order IDs is not presented, exit the function
      if( !isset( $_REQUEST['post'] ) &amp;&amp; !is_array( $_REQUEST['post'] ) )
          return;
  
      // New order emails
      foreach( $_REQUEST['post'] as $order_id ) {
  
          $order = new WC_Order( $order_id );
          $order_note = 'Changed Status to Completed via bulk edit (no confirmation email)';
          $order-&gt;update_status('completed', $order_note); //STILL SENDS EMAIL
      }
  
      // of course using add_query_arg() is not required, you can build your URL inline
      $location = add_query_arg( array(
          'post_type' =&gt; 'shop_order',
          'changed' =&gt; count( $_REQUEST['post'] ), // number of changed orders
          'ids' =&gt; join( $_REQUEST['post'], ',' ),
          'marked_fulfilled_no_emails' =&gt; 1,
          'post_status' =&gt; 'all'
      ), 'edit.php' );
  
      wp_redirect( admin_url( $location ) );
      exit;
  
  }
  
  /*
   * Notices for Bulk Action 
   */
  add_action('admin_notices', 'custom_order_status_notices');
  
  function custom_order_status_notices() {
  
      global $pagenow, $typenow;
  
      if( $typenow == 'shop_order' 
       &amp;&amp; $pagenow == 'edit.php'
       &amp;&amp; isset( $_REQUEST['marked_fulfilled_no_emails'] )
       &amp;&amp; $_REQUEST['marked_fulfilled_no_emails'] == 1
       &amp;&amp; isset( $_REQUEST['changed'] ) ) {
  
          $message = sprintf( _n( 'Order status changed.', '%s order statuses changed.', $_REQUEST['changed'] ), number_format_i18n( $_REQUEST['changed'] ) );
          echo "&lt;div class=\"updated\"&gt;&lt;p&gt;{$message}&lt;/p&gt;&lt;/div&gt;";
  
      }
  
  }
  </code></pre>
  
  <p>Wanting to avoid triggering confirmation emails when using a custom bulk edit option from orders. </p>