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


PHP ITSEC_Core::is_interactive方法代码示例

本文整理汇总了PHP中ITSEC_Core::is_interactive方法的典型用法代码示例。如果您正苦于以下问题:PHP ITSEC_Core::is_interactive方法的具体用法?PHP ITSEC_Core::is_interactive怎么用?PHP ITSEC_Core::is_interactive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITSEC_Core的用法示例。


在下文中一共展示了ITSEC_Core::is_interactive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: validate_settings

 protected function validate_settings()
 {
     // Only validate settings if the data was successfully sanitized.
     if (!$this->can_save()) {
         return;
     }
     require_once dirname(__FILE__) . '/utilities.php';
     $id = $this->get_id();
     if ('one-time' === $this->settings['type']) {
         if ($this->settings['start'] >= $this->settings['end']) {
             /* translators: 1: "Start Date", 2: "Start Time", 3: "End Date", 4: "End Time" */
             $this->add_error(new WP_Error("itsec-validator-{$id}-start-after-end", sprintf(__('The %1$s and %2$s must be before the %3$s and %4$s.', 'better-wp-security'), __('Start Date', 'better-wp-security'), __('Start Time', 'better-wp-security'), __('End Date', 'better-wp-security'), __('End Time', 'better-wp-security'))));
             $this->set_can_save(false);
         } else {
             if (false === ITSEC_Away_Mode_Utilities::is_current_timestamp_active($this->settings['start'], $this->settings['end'], true)) {
                 /* translators: 1: "End Date", 2: "End Time" */
                 $this->add_error(new WP_Error("itsec-validator-{$id}-end-already-ended", sprintf(__('The selected restriction date and time has already ended. Please select an %1$s and %2$s that has not already ended.', 'better-wp-security'), __('End Date', 'better-wp-security'), __('End Time', 'better-wp-security'))));
                 $this->set_can_save(false);
             } else {
                 if (ITSEC_Core::is_interactive() && ITSEC_Away_Mode_Utilities::is_current_timestamp_active($this->settings['start'], $this->settings['end'])) {
                     /* translators: 1: "Start Date", 2: "Start Time" */
                     $this->add_error(new WP_Error("itsec-validator-{$id}-start-already-started", sprintf(__('The selected restriction date and time has already started and would result in locking you out immediately. Please select a %1$s and %2$s that has not already started.', 'better-wp-security'), __('Start Date', 'better-wp-security'), __('Start Time', 'better-wp-security'))));
                     $this->set_can_save(false);
                 }
             }
         }
     } else {
         if ($this->settings['start_time'] === $this->settings['end_time']) {
             /* translators: 1: "Start Time", 2: "End Time" */
             $this->add_error(new WP_Error("itsec-validator-{$id}-start-equals-end", sprintf(__('The %1$s and %2$s cannot be the same.', 'better-wp-security'), __('Start Time', 'better-wp-security'), __('End Time', 'better-wp-security'))));
             $this->set_can_save(false);
         } else {
             if (ITSEC_Core::is_interactive() && ITSEC_Away_Mode_Utilities::is_current_time_active($this->settings['start_time'], $this->settings['end_time'])) {
                 /* translators: 1: "Start Time", 2: "End Time" */
                 $this->add_error(new WP_Error("itsec-validator-{$id}-settings-result-in-current-lockout", sprintf(__('The %1$s and %2$s settings restrict the current time and would result in locking you out immediately. Please select a %1$s and %2$s that does not restrict the current time.', 'better-wp-security'), __('Start Time', 'better-wp-security'), __('End Time', 'better-wp-security'))));
                 $this->set_can_save(false);
             }
         }
     }
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:40,代码来源:validator.php


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