title: WP Options detecting which button was pressed
body: <p>I am creating a custom plugin and have an options page. My variables are saving when I click the save button, but I want to add a second button and detect which button was pressed. I've been trying to put names in the buttons and was hoping to detect them via isset $_POST['name'] {}, but when I click the save or the other button, it just saved my variables, but does not put anything in the POST variable. As you can see in the code, one button saves the variables from a form the other button that saves and runs some script using those variables. The problem is that I need the page to know what button was clicked after the reload, you can see my attempt on discerning which button was clicked on the very bottom.
  I would prefer a php solution, so I can progressive enhance. Thanks!</p>
  
  <pre><code>&lt;div class="wrap"&gt;
  &lt;h2&gt;Config Me Bro&lt;/h2&gt;
  &lt;form method="post" action="options.php"&gt;
      &lt;?php settings_fields('aug_options'); ?&gt;
      &lt;?php $options = get_option('data_value'); ?&gt;
      &lt;label for=""&gt;Checkbox&lt;/label&gt;
            &lt;input name="data_value[option1]" type="checkbox" value="1" id="" &lt;?php checked('1', $options['option1']); ?&gt; /&gt;
       &lt;label for="general_title"&gt;Title&lt;/label&gt;
             &lt;input type="text" name="data_value[sometext]" id="general_title" value="&lt;?php echo $options['sometext']; ?&gt;" /&gt;
  
      &lt;p class="submit"&gt;
          &lt;?php submit_button('Save Changes', 'primary', 'save_config', false); ?&gt;
          &lt;?php submit_button('Run Config', 'secondary', 'run_config', false); ?&gt;
      &lt;/p&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;pre&gt; &lt;?php print_r($_POST);?&gt;&lt;/pre&gt;
  &lt;?php
  }
  
  /* Run Config Settings */
  if (isset($_POST['run_config'])){
       echo '&lt;h1&gt;I am running&lt;/h1&gt;';
  }
  /* Save config Settings */
  elseif (isset($_POST['save_config'])){
     echo '&lt;h1&gt;Saved it&lt;/h1&gt;';
  }
  </code></pre>