public function initialize() { if (!class_exists('App_Locations_Model')) { return false; } global $appointments; $this->_data = $appointments->options; if (empty($this->_data['service_locations'])) { $this->_data['service_locations'] = array(); } $this->_locations = App_Locations_Model::get_instance(); if (empty($this->_data['service_locations']['insert']) || 'manual' == $this->_data['service_locations']['insert']) { add_shortcode('app_service_location', array($this, 'process_shortcode')); } else { add_shortcode('app_service_location', '__return_false'); add_filter('app-services-service_description', array($this, 'inject_location_markup'), 10, 3); } if (!class_exists('App_Shortcode_ServiceLocationsShortcode')) { require_once dirname(__FILE__) . '/lib/app_service_locations_shortcode.php'; App_Shortcode_ServiceLocationsShortcode::serve(); App_Shortcode_RequiredServiceLocationsShortcode::serve(); } }
public function process_shortcode($args = array(), $content = '') { $instance = App_Shortcodes::get_shortcode_instance('app_services'); return !empty($this->_requested_location_id) && $instance && method_exists($instance, 'process_shortcode') ? $instance->process_shortcode($args, $content) : parent::process_shortcode($args, $content); }