/**
  * 	run - initial shortcode module setup called during "wp_loaded" hook
  * 	this method is primarily used for loading resources that will be required by the shortcode when it is actually processed
  *
  *  @access 	public
  *  @param  	WP $WP
  *  @return 	void
  */
 public function run(WP $WP)
 {
     // ensure this shortcode doesn't trigger on anything BUT the thank you page
     if (isset($WP->request) && basename($WP->request) != basename(EE_Registry::instance()->CFG->core->thank_you_page_url())) {
         return;
     } else {
         if (isset($WP->query_vars['page_id']) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id) {
             return;
         }
     }
     $this->_get_reg_url_link();
     // resend_reg_confirmation_email ?
     if (EE_Registry::instance()->REQ->is_set('resend')) {
         EES_Espresso_Thank_You::resend_reg_confirmation_email();
     }
     // load assets
     add_action('wp_enqueue_scripts', array($this, 'load_js'), 10);
     EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
 }
 /**
  * 	run - initial shortcode module setup called during "wp_loaded" hook
  * 	this method is primarily used for loading resources that will be required by the shortcode when it is actually processed
  *
  *  @access 	public
  *  @param  	WP $WP
  *  @return 	void
  */
 public function run(WP $WP)
 {
     // remove site_url() from thank you page URL
     $thank_you_page_URL = substr(EE_Registry::instance()->CFG->core->thank_you_page_url(), strlen(site_url()));
     // remove other non-essential details from URL
     $thank_you_page_URL = trim(parse_url($thank_you_page_URL, PHP_URL_PATH), '/');
     // ensure this shortcode doesn't trigger on anything BUT the thank you page
     if (isset($WP->request) && trim($WP->request, '/') != $thank_you_page_URL) {
         return;
     } else {
         if (isset($WP->query_vars['page_id']) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id) {
             return;
         }
     }
     $this->_get_reg_url_link();
     // resend_reg_confirmation_email ?
     if (EE_Registry::instance()->REQ->is_set('resend')) {
         EES_Espresso_Thank_You::resend_reg_confirmation_email();
     }
     // load assets
     add_action('wp_enqueue_scripts', array($this, 'load_js'), 10);
     EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
     $this->_translate_strings();
 }
 /**
  * 	run - initial shortcode module setup called during "wp_loaded" hook
  * 	this method is primarily used for loading resources that will be required by the shortcode when it is actually processed
  *
  *  @access 	public
  *  @param  	WP $WP
  *  @return 	void
  */
 public function run(WP $WP)
 {
     // ensure this shortcode doesn't trigger on anything BUT the thank you page
     if (isset($WP->request) && basename($WP->request) != basename(EE_Registry::instance()->CFG->core->thank_you_page_url())) {
         return;
     } else {
         if (isset($WP->query_vars['page_id']) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id) {
             return;
         }
     }
     // only do thank you page stuff if we have a REG_url_link in the url
     if (!EE_Registry::instance()->REQ->is_set('e_reg_url_link')) {
         EE_Error::add_error(__('No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
         return;
     }
     // check for reg_url_link
     $this->_reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link');
     // and retrieve the current TXN
     $this->_current_txn = EE_Registry::instance()->load_model('Transaction')->get_transaction_from_reg_url_link();
     // verify TXN
     if (!$this->_current_txn instanceof EE_Transaction) {
         EE_Error::add_error(__('No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
         return;
     }
     if (EE_Registry::instance()->REQ->is_set('resend')) {
         return EES_Espresso_Thank_You::resend_reg_confirmation_email();
     }
     // soon to be derprecated
     EE_Registry::instance()->load_model('Gateways')->thank_you_page_logic($this->_current_txn);
     EE_Registry::instance()->LIB->EEM_Gateways->reset_session_data();
     // load assets
     add_action('wp_enqueue_scripts', array($this, 'load_js'), 10);
     add_action('shutdown', array(EE_Session::instance(), 'clear_session'));
     return;
 }