/** * _load_and_instantiate_reg_step * * @access private * @param array $reg_step * @param int $order * @return bool */ private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) { // we need a file_path, class_name, and slug to add a reg step if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) { // if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step) if ($this->checkout->reg_url_link && $this->checkout->step !== $reg_step['slug'] && $reg_step['slug'] !== 'finalize_registration') { return true; } // instantiate step class using file path and class name $reg_step_obj = EE_Registry::instance()->load_file($reg_step['file_path'], $reg_step['class_name'], 'class', $this->checkout, FALSE); // did we gets the goods ? if ($reg_step_obj instanceof EE_SPCO_Reg_Step) { // set reg step order based on config $reg_step_obj->set_order($order); // add instantiated reg step object to the master reg steps array $this->checkout->add_reg_step($reg_step_obj); } else { EE_Error::add_error(__('The current step could not be set.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); return false; } } else { if (WP_DEBUG) { EE_Error::add_error(sprintf(__('A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso'), isset($reg_step['file_path']) ? $reg_step['file_path'] : '', isset($reg_step['class_name']) ? $reg_step['class_name'] : '', isset($reg_step['slug']) ? $reg_step['slug'] : '', '<ul>', '<li>', '</li>', '</ul>'), __FILE__, __FUNCTION__, __LINE__); } return false; } return true; }