get_payment_method_title(); // No updated status for orders delivered with Bank wire, Cash on delivery and Cheque payment methods. if ( in_array( $order->get_payment_method(), array( 'bacs', 'cod', 'cheque', '' ) ) ) { // Credit: https://stackoverflow.com/a/35689563 return; } $order->update_status( 'completed' ); });