Esempio n. 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 HMBKP_Scheduled_Backup(sanitize_text_field(urldecode($_GET['hmbkp_schedule_id'])));
    $schedule->cancel(true);
    wp_safe_redirect(hmbkp_get_settings_url(), 303);
    die;
}
Esempio n. 2
0
/**
 * Delete a schedule and all it's backups and then redirect
 * back to the backups page
 */
function hmbkp_request_delete_schedule()
{
    if (empty($_GET['action']) || $_GET['action'] !== 'hmbkp_delete_schedule' || !check_admin_referer('hmbkp-delete_schedule')) {
        return;
    }
    $schedule = new HMBKP_Scheduled_Backup(sanitize_text_field(urldecode($_GET['hmbkp_schedule_id'])));
    $schedule->cancel(true);
    wp_redirect(remove_query_arg(array('hmbkp_schedule_id', 'action', '_wpnonce')), 303);
    die;
}