<?php
/**
 * Hoot Theme files
 */

/* Load theme includes. Must keep priority 10 for theme constants to be available. */
add_action( 'after_setup_theme', 'maglume_includes', 10 );

/* Check if correct plugin version is loaded */
add_filter( 'maglume_min_plugin_version', 'maglume_min_plugin_version' );
function maglume_min_plugin_version( $version ) {
	return $version ? $version : '1.0.0';
}

/* Set minimum HootKit version required */
add_filter( 'hootkit_version_required', 'hoot_hootkit_version_required', 5 );
function hoot_hootkit_version_required() {
	return '3.0.2';
}

/**
 * Loads the theme files supported by themes and template-related functions/classes. Functionality 
 * in these files should not be expected within the theme setup function.
 *
 * @since 1.0
 * @access public
 * @return void
 */
function maglume_includes() {

	/* Load the Theme Specific HTML attributes */
	require_once( hoot_data()->incdir . 'attr.php' );
	require_once( hoot_data()->incdir . 'attr-aos.php' );
	/* Load enqueue functions */
	require_once( hoot_data()->incdir . 'enqueue.php' );
	/* Load the dynamic css functions. */
	require_once( hoot_data()->incdir . 'css.php' );
	/* Load template tags. */
	require_once( hoot_data()->incdir . 'template-helpers.php' );
	/* Set image sizes. */
	require_once( hoot_data()->incdir . 'admin/media.php' );
	/* Set menus */
	require_once( hoot_data()->incdir . 'admin/menus.php' );
	/* Set sidebars */
	require_once( hoot_data()->incdir . 'admin/sidebars.php' );
	require_once( hoot_data()->incdir . 'admin/widgets.php' );
	/* Category Colors */
	require_once( hoot_data()->incdir . 'admin/category.php' );
	/* Helper Functions */
	require_once( hoot_data()->incdir . 'admin/functions.php' );
	/* Load Customizer Options */
	if ( apply_filters( 'maglume_customize_load_trt', file_exists( hoot_data()->incdir . 'admin/trt-customize-pro/class-customize.php' ) ) )
		require_once( hoot_data()->incdir . 'admin/trt-customize-pro/class-customize.php' );
	require_once( hoot_data()->incdir . 'admin/customizer-options.php' );
	require_once( hoot_data()->incdir . 'admin/customizer-helpers.php' );
	/* Load the about page. */
	if ( apply_filters( 'maglume_load_about', ( file_exists( hoot_data()->incdir . 'admin/about.php' ) && file_exists( hoot_data()->incdir . 'admin/notice.php' ) ) ) ) {
		require_once( hoot_data()->incdir . 'admin/about.php' );
		require_once( hoot_data()->incdir . 'admin/notice.php' );
	}
	/* Load the theme setup file */
	require_once( hoot_data()->incdir . 'theme-setup.php' );
	require_once( hoot_data()->incdir . 'blocks/wpblocks.php' );

}

/* Theme Setup complete */
do_action( 'maglume_loaded' );