當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。