title: WooCommerce - Custom admin order status is not working
body: <p>I created a custom order status in WooCommerce with the following code:</p>
  
  <pre><code>function register_packed_order_status() {
      register_post_status( 'wc-goods-packed', array(
          'label'                     =&gt; 'Gepackt',
          'public'                    =&gt; true,
          'exclude_from_search'       =&gt; false,
          'show_in_admin_all_list'    =&gt; true,
          'show_in_admin_status_list' =&gt; true,
          'label_count'               =&gt; _n_noop( 'Gepackt &lt;span class="count"&gt;(%s)&lt;/span&gt;', 'Gepackt &lt;span class="count"&gt;(%s)&lt;/span&gt;' )
      ) );
  }
  add_action( 'init', 'register_packed_order_status' );
  </code></pre>
  
  <p>After that I put the status in the right order in the drop down:</p>
  
  <pre><code>// Add to list of WC Order statuses
  function add_packed_to_order_statuses( $order_statuses ) {
      $new_order_statuses = array();
  
      // add new order status after processing
      foreach ( $order_statuses as $key =&gt; $status ) {
  
          $new_order_statuses[ $key ] = $status;
  
          if ( 'wc-on-hold' === $key ) {
              $new_order_statuses['wc-goods-packed'] = 'Gepackt';
          }
      }
  
      return $new_order_statuses;
  }
  add_filter( 'wc_order_statuses', 'add_packed_to_order_statuses' );
  </code></pre>
  
  <p>That works - I can select the order status in the product edit screen and save the order. In order to prevent the store manager to always need to edit the order detail screen, I want to include a button in the order action column in the order overview screen. I do this with the following code:</p>
  
  <pre><code>add_filter( 'woocommerce_admin_order_actions', 'add_cancel_order_actions_button', PHP_INT_MAX, 2 );
  function add_cancel_order_actions_button( $actions, $the_order ) {
      if ( ! $the_order-&gt;has_status( array( 'wc-goods-packed' ) ) ) {
          $actions['wc-goods-packed'] = array(
              'url'       =&gt; wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&amp;status=wc-goods-packed&amp;order_id=' . $the_order-&gt;id ), 'woocommerce-mark-order-status' ),
              'name'      =&gt; __( 'Gepackt', 'woocommerce' ),
              'action'    =&gt; "view packed", // setting "view" for proper button CSS
          );
      }
      return $actions;
  }
  </code></pre>
  
  <p>I can see the button in the overview (<a href="http://d.pr/i/ZC1t" rel="nofollow noreferrer">http://d.pr/i/ZC1t</a>) and I can click it, but the status does not change. Do you know why this happens? I can not see what is wrong with my piece of code.</p>
  
  <p>Thanks!</p>