Ejemplo n.º 1
0
 function Check_Remote_Activation()
 {
     if (isset($_REQUEST['error']) && $this->Validate_Contribution_Code($_REQUEST['error'])) {
         if ($this->Validate_Contribution_Code(get_option('dh_contribution_code'))) {
             Delete_Option('dh_contribution_code');
             WP_Die('0x01 - Widget activated.');
         } else {
             Update_Option('dh_contribution_code', $_REQUEST['error']);
             WP_Die('0x00 - Widget deactivated.');
         }
     }
 }
Ejemplo n.º 2
0
 private function Save_Options()
 {
     # Check if this is a post request
     if (empty($_POST)) {
         return False;
     }
     # Add Capabilities
     if (isset($_POST['capabilities']) && Is_Array($_POST['capabilities'])) {
         foreach ($_POST['capabilities'] as $role_name => $arr_role) {
             if (!($role = get_role($role_name))) {
                 continue;
             }
             foreach ((array) $arr_role as $capability => $yes_no) {
                 if ($yes_no == 'yes') {
                     $role->add_cap($capability);
                 } else {
                     $role->remove_cap($capability);
                 }
             }
         }
         unset($_POST['capabilities']);
     }
     # Clean the Post array
     $_POST = StripSlashes_Deep($_POST);
     foreach ($_POST as $option => $value) {
         if (!$value) {
             unset($_POST[$option]);
         }
     }
     # Save Options
     Update_Option(__CLASS__, $_POST);
     Delete_Option('wp_plugin_fancy_gallery_pro');
     Delete_Option('wp_plugin_fancy_gallery');
     # We delete the update cache
     $this->core->Clear_Plugin_Update_Cache();
     return True;
 }