當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EE_Error::overwrite_errors方法代碼示例

本文整理匯總了PHP中EE_Error::overwrite_errors方法的典型用法代碼示例。如果您正苦於以下問題:PHP EE_Error::overwrite_errors方法的具體用法?PHP EE_Error::overwrite_errors怎麽用?PHP EE_Error::overwrite_errors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EE_Error的用法示例。


在下文中一共展示了EE_Error::overwrite_errors方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: verify_cpt_object

 /**
  * This simply verifies if the cpt_model_object is instantiated for the given page and throws an error message accordingly.
  *
  * @access public
  * @throws EE_Error
  * @return void
  */
 public function verify_cpt_object()
 {
     $label = !empty($this->_cpt_object) ? $this->_cpt_object->labels->singular_name : $this->page_label;
     // verify event object
     if (!$this->_cpt_model_obj instanceof EE_CPT_Base) {
         throw new EE_Error(sprintf(__('Something has gone wrong with the page load because we are unable to set up the object for the %1$s.  This usually happens when the given id for the page route is NOT for the correct custom post type for this page', 'event_espresso'), $label));
     }
     //if auto-draft then throw an error
     if ($this->_cpt_model_obj->get('status') == 'auto-draft') {
         EE_Error::overwrite_errors();
         EE_Error::add_error(sprintf(__('This %1$s was saved without a title, description, or excerpt which means that none of the extra details you added were saved properly.  All autodrafts will show up in the "draft" view of your event list table.  You can delete them from there. Please click the "Add %1$s" button to refresh and restart.'), $label), __FILE__, __FUNCTION__, __LINE__);
     }
 }
開發者ID:kaffiemetsuker,項目名稱:event-espresso-core,代碼行數:20,代碼來源:EE_Admin_Page_CPT.core.php

示例2: _migration_step

 function _migration_step($num_items = 50)
 {
     $items_actually_migrated = 0;
     $old_org_options = get_option('events_organization_settings');
     foreach ($this->_org_options_we_know_how_to_migrate as $option_name) {
         //only bother migrating if there's a setting to migrate. Otherwise we'll just use the default
         if (isset($old_org_options[$option_name])) {
             $this->_handle_org_option($option_name, $old_org_options[$option_name]);
         }
         if ($option_name == 'surcharge') {
             $this->_insert_new_global_surcharge_price($old_org_options);
         }
         $items_actually_migrated++;
     }
     $success = EE_Config::instance()->update_espresso_config(FALSE, TRUE);
     if (!$success) {
         $this->add_error(sprintf(__('Could not save EE Config during org options stage. Reason: %s', 'event_espresso'), EE_Error::get_notices(FALSE)));
         EE_Error::overwrite_errors();
     }
     EE_Network_Config::instance()->update_config(FALSE, FALSE);
     if ($this->count_records_migrated() + $items_actually_migrated >= $this->count_records_to_migrate()) {
         //we may have added new pages and this might be necessary
         flush_rewrite_rules();
         $this->set_completed();
     }
     return $items_actually_migrated;
 }
開發者ID:DavidSteinbauer,項目名稱:event-espresso-core,代碼行數:27,代碼來源:EE_DMS_4_1_0_org_options.dmsstage.php

示例3: send_now

    /**
     * Sends messages immediately for the incoming message_ids that have the status of EEM_Message::status_resend or,
     * EEM_Message::status_idle
     *
     * @since 4.9.0
     * @param $message_ids
     *
     * @return bool | EE_Messages_Queue  false if no messages sent.
     */
    public static function send_now($message_ids)
    {
        self::_load_controller();
        $messages = EEM_Message::instance()->get_all(array(0 => array('MSG_ID' => array('IN', $message_ids), 'STS_ID' => array('IN', array(EEM_Message::status_idle, EEM_Message::status_resend, EEM_Message::status_retry)))));
        $sent_queue = false;
        if ($messages) {
            $sent_queue = self::$_MSG_PROCESSOR->batch_send_from_queue($messages);
        }
        if (!$sent_queue instanceof EE_Messages_Queue) {
            EE_Error::add_error(__('The messages were not sent. This could mean there is already a batch being sent on a separate request, or because the selected messages are not sendable. Please wait a minute or two and try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
        } else {
            //can count how many sent by using the messages in the queue
            $sent_count = $sent_queue->count_STS_in_queue(EEM_Message::instance()->stati_indicating_sent());
            if ($sent_count > 0) {
                EE_Error::add_success(sprintf(_n('There was %d message successfully sent.', 'There were %d messages successfully sent.', $sent_count, 'event_espresso'), $sent_count));
            } else {
                EE_Error::overwrite_errors();
                EE_Error::add_error(__('No message was sent because of problems with sending. Either all the messages you selected were not a sendable message, they were ALREADY sent on a different scheduled task, or there was an error.
					If there was an error, you can look at the messages in the message activity list table for any error messages.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
            }
        }
        return $sent_queue;
    }
開發者ID:aaronfrey,項目名稱:PepperLillie-GSP,代碼行數:32,代碼來源:EED_Messages.module.php


注:本文中的EE_Error::overwrite_errors方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。