title: How to jump out a loop after 2 cases?
body: <p>There is a loop in the function I want to modify:</p>
  
  <pre><code>foreach ( $form_fields as $key =&gt; $val ) {
          if ( 'menu_order' == $key ) {
              if ( $gallery )
                  $order = "&lt;div class='menu_order'&gt; &lt;input class='menu_order_input' type='text' id='attachments[$attachment_id][menu_order]' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ). "' /&gt;&lt;/div&gt;";
              else
                  $order = "&lt;input type='hidden' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ) . "' /&gt;";
  
              unset( $form_fields['menu_order'] );
              break;
          }
      }
  </code></pre>
  
  <p>This loop is looping through $form_fields array. if "menu_order" is the key, then, do something and break. Now I want to add one more key to do things as the above. So, I modified it as following:</p>
  
  <pre><code>foreach ( $form_fields as $key =&gt; $val ) {
      if ( 'menu_order' == $key ) {
          if ( $gallery )
              $order = "&lt;div class='menu_order'&gt; &lt;input class='menu_order_input' type='text' id='attachments[$attachment_id][menu_order]' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ). "' /&gt;&lt;/div&gt;";
          else
              $order = "&lt;input type='hidden' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ) . "' /&gt;";
  
          unset( $form_fields['menu_order'] );
  
      }
  
      if ( 'post_status' == $key ) {
      if ( $gallery )
          $status = "&lt;div class='post_status'&gt; &lt;input class='post_status_input' type='text' id='attachments[$attachment_id][post_status]' name='attachments[$attachment_id][post_status]' value='" . esc_attr( $val['value'] ). "' /&gt;&lt;/div&gt;";
      else
          $status = "&lt;input type='hidden' name='attachments[$attachment_id][post_status]' value='" . esc_attr( $val['value'] ) . "' /&gt;";
  
      unset( $form_fields['post_status'] );
      break;
  }
  
  }
  </code></pre>
  
  <p>Please note that I removed the break in original code, add the break at the end of the loop. I think this should make the loop going till it finished my newly added block.
  But this code doesn't print the post_status input box as expected. Where did I go wrong in the loop? </p>