/** * 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) { if (!did_action('pre_get_posts')) { // hook into the top of pre_get_posts to set the reg step routing, which gives other modules or plugins a chance to modify the reg steps, but just before the routes get called add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1); // this will trigger the EED_Single_Page_Checkout module's run() method during the pre_get_posts hook point, // this allows us to initialize things, enqueue assets, etc, add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'init'), 10, 1); } else { global $wp_query; EED_Single_Page_Checkout::load_reg_steps(); EED_Single_Page_Checkout::init($wp_query); } }
/** * process_registration_from_admin * * @access public * @return int */ public static function process_registration_from_admin() { EED_Single_Page_Checkout::load_reg_steps(); EE_Registry::instance()->REQ->set('step', 'attendee_information'); EE_Registry::instance()->REQ->set('action', 'process_reg_step'); EE_Registry::instance()->REQ->set('process_form_submission', true); EED_Single_Page_Checkout::instance()->_initialize(); if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) { $final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps); if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) { if ($final_reg_step->process_reg_step()) { return EED_Single_Page_Checkout::instance()->checkout->transaction; } } } return FALSE; }