WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm combining two of my plugins into one. I'd like to make the activation routine of the second plugin a checkbox selection in the settings panel of the new plugin.

However, I'm unsure how to execute functions when the options are submitted. How can I do this?

The my-plugin-options.php is basically this...

<form method="post" action="options.php">
<?php wp_nonce_field('update-options'); ?>
//options form goes here
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="check1, check2, check3, etc" />
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />

And its called from my main plugin file with this...

function my_settings_admin() {
include_once dirname(__FILE__) . '/my-plugin-options.php';

 add_options_page( 'My Plugin Settings', 
    'My Plugin Settings', 
share|improve this question
up vote 2 down vote accepted

If you are using the Settings API, then I'd say to add a check and function call for it in your sanitization callback (from register_setting).

share|improve this answer
I'm partially using it now. Checking out the tutorials at your link now. Thanks! – Scott B Feb 5 '11 at 15:30
I was able to figure it out, between your link and this one > planetozh.com/blog/2009/05/… – Scott B Feb 5 '11 at 18:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.