<?php
define( 'SCHOOL_TIME_THEME_OPTION_NAME', 'school_time_options' );
define( 'SCHOOL_TIME_THEME_NAME', 'school-time' );
define( 'SCHOOL_TIME_THEME_PLUGIN_NAME', 'school-time-plugin' );
define( 'SCHOOL_TIME_THEME_PREFIX', 'school_time_' );

/**
 *  Length in words for excerpt_length filter (http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_length)
 * This is just theme default value - it is overridden from theme options
 */ 
define( 'POST_EXCERPT_LENGTH', 40 );

add_theme_support( 'title-tag' );

if ( ! isset( $content_width ) ) {
	$content_width = 1200;
}

/**
 * Woocommerce Support Declaration
 */
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );

/**
 * Force Visual Composer to initialize as "built into the theme". 
 * This will hide certain tabs under the Settings->Visual Composer page
 */
add_action( 'vc_before_init', 'school_time_vc_set_as_theme' );
function school_time_vc_set_as_theme() {
	vc_set_as_theme( true );
	if( defined('WPB_VC_VERSION') ) {
		$_COOKIE['vchideactivationmsg_vc11'] = WPB_VC_VERSION;
	}
}

/**
 * Layer Slider
 */
add_action( 'layerslider_ready', 'school_time_layerslider_overrides' );
function school_time_layerslider_overrides() {
	// Disable auto-updates
	$GLOBALS['lsAutoUpdateBox'] = false;
	update_option( 'layerslider-authorized-site', true );
}

/**
 * Mega Menus
 */
add_action( 'msm_filter_use_redux', 'school_time_use_msm_redux' );
function school_time_use_msm_redux() {
	return false;
}
