constants(); $this->theme_support(); $this->post_type_support(); } /** * Loads all the parent theme files * * @since 1.0.0 */ public function launch() { # Hook in before the action happens do_action( 'bizznis_pre_woocommerce_integration' ); # Stop here, if bizznis woocommerce integratin is not defined if ( ! current_theme_supports( 'bizznis-woocommerce' ) ) { return; } # Environment is OK, let's go! global $woocommerce; # Load Functions if ( ! current_theme_supports( 'bizznis-woo-breadcrumbs') ) { load_template( BIZZNIS_WC_INC_DIR . '/breadcrumb.php' ); } load_template( BIZZNIS_WC_INC_DIR . '/template-loader.php' ); # Take control of shop template loading remove_filter( 'template_include', array( &$woocommerce, 'template_loader' ) ); add_filter( 'template_include', 'bizznis_wc_template_loader', 20 ); } /** * Defines theme constants throughout the template * * @since 1.0.0 */ private function constants() { # Directory Locations define( 'BIZZNIS_WC_INC_DIR', BIZZNIS_INT_WC_DIR . '/inc' ); define( 'BIZZNIS_WC_TEMPLATES_DIR', BIZZNIS_INT_WC_DIR . '/templates' ); # URL Locations define( 'BIZZNIS_WC_INC_URL', BIZZNIS_INT_WC_URL . '/inc' ); define( 'BIZZNIS_WC_TEMPLATES_URL', BIZZNIS_INT_WC_URL . '/templates' ); } /** * Activates default theme features. * * @since 1.0.0 */ public function theme_support() { add_theme_support( 'woocommerce' ); add_theme_support( 'bizznis-woocommerce' ); } /** * Initialize post type support for Bizznis features (Layout selector, Scripts). * * @since 1.0.0 */ public function post_type_support() { add_post_type_support( 'product', array( 'bizznis-scripts', 'bizznis-layouts' ) ); } } /** * Launch the ingration class * * @since 1.0.0 */ add_action( 'after_setup_theme', 'bizznis_wc_integration' ); function bizznis_wc_integration() { $bizznis = new Bizznis_WC; #ready, set, go! $bizznis->launch(); }