当前位置: 首页>>代码示例>>PHP>>正文


PHP pb_backupbuddy_settings::clear_values方法代码示例

本文整理汇总了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.
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:scheduling.php


注:本文中的pb_backupbuddy_settings::clear_values方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。