Update option hook not firing

Because you’re registering your hook inside the function that is rendering the form. When the form is submitted, the update_option action has already run before it gets to displaying the form. Move it outside the function. As it appears you’re using a class, adding the action to the __construct method might be a good idea.

Export and import all Plugin options

The Codex suggests that you use wp_load_alloptions instead. I would suggest that you therefore use wp_load_alloptions. That technically answers the question, I think. wp_load_alloptions will pull all of the options out of the options table and your question does not explain why you need to do that. Are you actually needing to pull only your … Read more

Output checkbox per user and save in plugin options

Change the [user] to [users][]. Hope that will fix the problem. Now you’ll get all the value in associative array within [users][‘your-checkbox-data-array’] So your code will be like- <?php $WPusers = get_users( ‘orderby=nicename&role=administrator’ ); foreach ( $WPusers as $user ) { ?> <input type=”checkbox” name=”<?php echo $this->plugin_name; ?>[users][]” id=”<?php echo $this->plugin_name; ?>-users” value=”<?php echo $user->ID; … Read more