public function __construct() { parent::__construct(); ShoppCatalog(); Shopping::restore('search', $this->search); Shopping::restore('browsing', $this->browsing); Shopping::restore('referrer', $this->referrer); Shopping::restore('viewed', $this->viewed); // Setup WP_Query overrides add_action('parse_query', array($this, 'query')); add_filter('posts_request', array($this, 'noquery'), 10, 2); add_filter('posts_request', array($this, 'onfront'), 10, 2); add_filter('posts_results', array($this, 'found'), 10, 2); add_filter('the_posts', array($this, 'posts'), 10, 2); add_action('wp', array($this, 'loaded')); add_action('wp', array($this, 'security')); add_action('wp', array($this, 'trackurl')); add_action('wp', array($this, 'viewed')); add_action('wp', array($this, 'cart')); add_action('wp', array($this, 'dashboard')); add_action('wp', array($this, 'shortcodes')); add_action('wp', array($this, 'behaviors')); add_filter('wp_get_nav_menu_items', array($this, 'menulinks'), 10, 2); add_filter('wp_list_pages', array($this, 'securelinks')); // Wrap Shopp content in #shopp div to enable CSS and Javascript add_filter('shopp_order_lookup', array('Storefront', 'wrapper')); add_filter('shopp_order_confirmation', array('Storefront', 'wrapper')); add_filter('shopp_errors_page', array('Storefront', 'wrapper')); add_filter('shopp_catalog_template', array('Storefront', 'wrapper')); add_filter('shopp_cart_template', array('Storefront', 'wrapper')); add_filter('shopp_checkout_page', array('Storefront', 'wrapper')); add_filter('shopp_account_template', array('Storefront', 'wrapper')); add_filter('shopp_category_template', array('Storefront', 'wrapper')); add_filter('shopp_order_receipt', array('Storefront', 'wrapper')); add_filter('shopp_account_manager', array('Storefront', 'wrapper')); add_filter('shopp_account_vieworder', array('Storefront', 'wrapper')); add_filter('the_content', array($this, 'autowrap'), 99); add_action('wp_enqueue_scripts', 'shopp_dependencies'); add_action('shopp_storefront_init', array($this, 'account')); add_filter('wp_nav_menu_objects', array($this, 'menus')); // Maintenance mode overrides add_filter('search_template', array($this, 'maintenance')); add_filter('taxonomy_template', array($this, 'maintenance')); add_filter('page_template', array($this, 'maintenance')); add_filter('single_template', array($this, 'maintenance')); // Template rendering add_action('do_feed_rss2', array($this, 'feed'), 1); add_filter('search_template', array($this, 'pages')); add_filter('page_template', array($this, 'pages')); add_filter('archive_template', array($this, 'pages')); add_filter('taxonomy_template', array($this, 'collections')); add_filter('single_template', array($this, 'single')); }
/** * Returns the proper global context object used in a shopp('collection') call * * @internal * @since 1.2 * * @param ShoppStorefront $Object The ShoppOrder object to set as the working context * @param string $context The context being worked on by the Theme API * @return ShoppStorefront The active object context **/ public static function _setobject($Object, $object) { if (is_object($Object) && is_a($Object, 'ShoppCatalog')) { return $Object; } switch (strtolower($object)) { case 'storefront': case 'catalog': return ShoppCatalog(); break; } return $Object; // not mine, do nothing }