示例#1
0
/**
 * Delete a schedule and all it's backups and then redirect back to the backups page
 */
function hmbkp_request_delete_schedule()
{
    check_admin_referer('hmbkp_delete_schedule', 'hmbkp_delete_schedule_nonce');
    $schedule = new HM\BackUpWordPress\Scheduled_Backup(sanitize_text_field(urldecode($_GET['hmbkp_schedule_id'])));
    $schedule->cancel(true);
    wp_safe_redirect(hmbkp_get_settings_url(), 303);
    die;
}
 function delete_schedule()
 {
     $schedule_id = $this->check_schedule();
     $schedule = new HM\BackUpWordPress\Scheduled_Backup(sanitize_text_field(urldecode($schedule_id)));
     if ($schedule) {
         $schedule->cancel(true);
         $information['result'] = 'SUCCESS';
     } else {
         $information['result'] = 'NOTFOUND';
     }
     return $information;
 }