Exemple #1
0
 function gmgt_general_setting()
 {
     $options = gmgt_option();
     foreach ($options as $key => $val) {
         add_option($key, $val);
     }
 }
<?php

if (isset($_POST['save_setting'])) {
    $optionval = gmgt_option();
    foreach ($optionval as $key => $val) {
        if (isset($_POST[$key])) {
            $result = update_option($key, $_POST[$key]);
        }
    }
    if (isset($_REQUEST['gym_enable_sandbox'])) {
        update_option('gym_enable_sandbox', 'yes');
    } else {
        update_option('gym_enable_sandbox', 'no');
    }
    if (isset($_REQUEST['gym_enable_memberlist_for_member'])) {
        update_option('gym_enable_memberlist_for_member', 'yes');
    } else {
        update_option('gym_enable_memberlist_for_member', 'no');
    }
    if (isset($_REQUEST['gym_enable_membership_alert_message'])) {
        update_option('gym_enable_membership_alert_message', 'yes');
    } else {
        update_option('gym_enable_membership_alert_message', 'no');
    }
    if (isset($result)) {
        ?>
	
					<div id="message" class="updated below-h2">
						<p><?php 
        _e('Record updated successfully', 'gym_mgt');
        ?>