本文整理汇总了PHP中pb_backupbuddy_settings::clear_values方法的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy_settings::clear_values方法的具体用法?PHP pb_backupbuddy_settings::clear_values怎么用?PHP pb_backupbuddy_settings::clear_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_backupbuddy_settings
的用法示例。
在下文中一共展示了pb_backupbuddy_settings::clear_values方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$error = true;
}
$schedule['remote_destinations'] = $submitted_schedule['data']['remote_destinations'];
$schedule['delete_after'] = $submitted_schedule['data']['delete_after'];
if ($error === false) {
$next_index = pb_backupbuddy::$options['next_schedule_index'];
// v2.1.3: $next_index = end( array_keys( pb_backupbuddy::$options['schedules'] ) ) + 1;
pb_backupbuddy::$options['next_schedule_index']++;
// This change will be saved in savesettings function below.
pb_backupbuddy::$options['schedules'][$next_index] = $schedule;
$result = wp_schedule_event($schedule['first_run'], $schedule['interval'], 'pb_backupbuddy-cron_scheduled_backup', array($next_index));
if ($result === false) {
pb_backupbuddy::alert('Error scheduling event with WordPress. Your schedule may not work properly. Please try again. Error #3488439.', true);
}
pb_backupbuddy::save();
$schedule_form->clear_values();
pb_backupbuddy::alert('Added new schedule `' . htmlentities($schedule['title']) . '`.');
}
} else {
// EDIT SCHEDULE. Forma handles saving; just need to update timestamp.
$first_run = pb_backupbuddy::$format->unlocalize_time(strtotime($submitted_schedule['data']['first_run']));
if ($first_run == 0 || $first_run == 18000) {
pb_backupbuddy::alert(sprintf(__('Invalid time format. Please use the specified format / example %s', 'it-l10n-backupbuddy'), $date_format_example));
$error = true;
}
pb_backupbuddy::$options['schedules'][pb_backupbuddy::_GET('edit')]['first_run'] = $first_run;
$next_scheduled_time = wp_next_scheduled('pb_backupbuddy-cron_scheduled_backup', array((int) $_GET['edit']));
wp_unschedule_event($next_scheduled_time, 'pb_backupbuddy-cron_scheduled_backup', array((int) $_GET['edit']));
// Remove old schedule. pb_backupbuddy::$options['schedules'][$_GET['edit']]['first_run']
$result = wp_schedule_event($first_run, $submitted_schedule['data']['interval'], 'pb_backupbuddy-cron_scheduled_backup', array((int) $_GET['edit']));
// Add new schedule.