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


PHP EE_Error::reset_notices方法代码示例

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


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

示例1: update_debug_logging_options

 /**
  * update_debug_logging_options
  *
  * @param array $admin_options
  * @return array
  */
 public function update_debug_logging_options($admin_options = array())
 {
     $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool) absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging;
     $admin_options->use_full_logging = $use_full_logging;
     if ($use_full_logging === FALSE) {
         EE_Error::get_notices(FALSE);
         EE_Error::reset_notices();
     }
     $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging;
     $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url;
     return $admin_options;
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:18,代码来源:Extend_General_Settings_Admin_Page.core.php

示例2: tearDown

 public function tearDown()
 {
     parent::tearDown();
     global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter, $current_user;
     $wp_filter = $this->wp_filters_saved['wp_filter'];
     $wp_actions = $this->wp_filters_saved['wp_actions'];
     $merged_filters = $this->wp_filters_saved['merged_filters'];
     $wp_current_filter = $this->wp_filters_saved['wp_current_filter'];
     $current_user = $this->_orig_current_user;
     $this->_detect_accidental_txn_commit();
     $notices = EE_Error::get_notices(false, false, true);
     EE_Error::reset_notices();
     if (!empty($notices['errors'])) {
         $this->fail($notices['errors']);
     }
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:16,代码来源:EE_UnitTestCase.class.php

示例3: test_prepare_for_display_with_EE_Error

 /**
  * Tests EE_Datetime_Field prepare_for_display method when it receives an invalid DateTime object on a
  * non-nullable field and WP_DEBUG is false.
  *
  * @since 4.7.0
  */
 public function test_prepare_for_display_with_EE_Error()
 {
     if (defined('WP_DEBUG') && WP_DEBUG) {
         $this->markTestSkipped('Unable to complete test because WP_DEBUG is already defined and is set to true');
     }
     $this->_set_dtt_field_object();
     $this->_datetime_field->prepare_for_display(null);
     //have error notice?
     $notice = EE_Error::get_notices(false);
     $notice = $notice['errors'];
     $expected = 'An error has occurred:<br />EE_Datetime_Field::_prepare_for_display requires a DateTime class to be the value for the $DateTime argument because the Start Date field is not nullable.  When WP_DEBUG is false, the value is set to "now" instead of throwing an exception.';
     $this->assertEquals($expected, $notice);
     EE_Error::reset_notices();
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:20,代码来源:EE_Datetime_Field_Test.php

示例4: update_debug_logging_options

 /**
  * update_debug_logging_options
  *
  * @param array $admin_options
  * @return array
  */
 public function update_debug_logging_options($admin_options = array())
 {
     $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool) absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging;
     // trying to enable full logging for the first time?
     if ($use_full_logging && $use_full_logging !== $admin_options->use_full_logging) {
         $admin_options->use_full_logging = $this->_request_filesystem_credentials() ? TRUE : NULL;
         if ($admin_options->use_full_logging === NULL) {
             add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false');
         }
     } else {
         $admin_options->use_full_logging = $use_full_logging;
     }
     if ($use_full_logging === FALSE) {
         EE_Error::get_notices(FALSE);
         EE_Error::reset_notices();
     }
     $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging;
     $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url;
     return $admin_options;
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:26,代码来源:Extend_General_Settings_Admin_Page.core.php

示例5: _final_verifications

 /**
  *    _final_verifications
  * just makes sure that everything is set up correctly before proceeding
  *
  * @access    private
  * @return    bool
  * @throws \EE_Error
  */
 private function _final_verifications()
 {
     // filter checkout
     $this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout);
     //verify that current step is still set correctly
     if (!$this->checkout->current_step instanceof EE_SPCO_Reg_Step) {
         EE_Error::add_error(__('We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
         return false;
     }
     // if returning to SPCO, then verify that primary registrant is set
     if (!empty($this->checkout->reg_url_link)) {
         $valid_registrant = $this->checkout->transaction->primary_registration();
         if (!$valid_registrant instanceof EE_Registration) {
             EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
             return false;
         }
         $valid_registrant = null;
         foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) {
             if ($registration instanceof EE_Registration && $registration->reg_url_link() === $this->checkout->reg_url_link) {
                 $valid_registrant = $registration;
             }
         }
         if (!$valid_registrant instanceof EE_Registration) {
             // hmmm... maybe we have the wrong session because the user is opening multiple tabs ?
             if (EED_Single_Page_Checkout::$_checkout_verified) {
                 // clear the session, mark the checkout as unverified, and try again
                 EE_Registry::instance()->SSN->clear_session();
                 EED_Single_Page_Checkout::$_initialized = false;
                 EED_Single_Page_Checkout::$_checkout_verified = false;
                 $this->_initialize();
                 EE_Error::reset_notices();
                 return false;
             }
             EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
             return false;
         }
     }
     // now that things have been kinda sufficiently verified,
     // let's add the checkout to the session so that's available other systems
     EE_Registry::instance()->SSN->set_checkout($this->checkout);
     return true;
 }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:50,代码来源:EED_Single_Page_Checkout.module.php


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