$data ) { if( !in_array( $name, $valid_options ) ) { wp_die('Invalid option found on submission, settings could not be saved.'); } } // If we've made this far, we should have options to save (and only valid ones) $options = array(); // Check which page was requested again if( 'General' == $plugin_page ) { // General options, let's escape any HTML $options = array_map('esc_html', $_POST ); } elseif( 'Privacy' == $plugin_page ) { // Privacy page, on / off setting, so only need a 0 vs 1 comparision check if( isset( $_POST['blog_public'] ) ) { if( 1 == $_POST['blog_public'] ) $options['blog_public'] = '1'; else $options['blog_public'] = '0'; } } if( !empty( $options ) ) { unset($_POST['submit']); // Let's not save the submit buttons value foreach( $options as $option_name => $option_value ) { update_option($option_name,$option_value); } } } ?>

Settings

/>
/>