Ejemplo n.º 1
0
function bfox_bp_bible_study_edit_schedule_screen_view_save()
{
    $schedule = bfox_bp_schedule();
    if (!is_null($schedule)) {
        if (isset($_POST['save']) && check_admin_referer('bfox_bp_plans_edit_schedule')) {
            bfox_bp_plans_save_schedule($schedule);
            bp_core_add_message(__('The schedule was updated.', 'bfox'));
            bp_core_redirect($schedule->url());
        } elseif (isset($_POST['delete']) && check_admin_referer('bfox_bp_plans_delete_schedule')) {
            BfoxReadingSchedule::delete_schedule($schedule);
            bp_core_add_message(__('The schedule was deleted.', 'bfox'));
            bp_core_redirect(bfox_bp_bible_study_calendar_url());
        }
    }
}