Example #1
0
<?php

if (is_admin() && is_user_logged_in() && current_user_can('install_plugins')) {
    $c = new ShareAndFollow();
    $c->cache_warning_check();
    if (isset($_POST['update_share-and-follow']) && isset($_POST['pnonce'])) {
        if (wp_verify_nonce($_POST['pnonce'], 'checkplugins')) {
            // save options
            // loop through defaults to get all possible keys
            foreach ($c->_defaults as $key => $value) {
                // check if key is set
                if (isset($_POST[$key])) {
                    // update the options variable
                    $c->_options[$key] = $_POST[$key];
                }
            }
            // update the settings using the options variable
            $c->update_plugin_options();
            ?>
<div class="updated"><p><strong><?php 
            _e("Settings Updated.", "share-and-follow");
            ?>
</strong></p></div><?php 
        } else {
            // trying to save without a good nonce
            wp_die('hacking?');
        }
    }
    ?>
            <div class="wrap">
            <?php