<?php
/**
 * TTSun Solar functions and definitions.
 *
 * @package ttsunsolar
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

define( 'TTSUNSOLAR_VERSION', '1.0' );
define( 'TTSUNSOLAR_DIR', get_template_directory() );
define( 'TTSUNSOLAR_URI', get_template_directory_uri() );
define( 'TTSUNSOLAR_VENDOR_URL', 'https://themestulip.com' );
define( 'TTSUNSOLAR_PRO_URL', 'https://themestulip.com/themes/solar-panel-wordpress-theme/' );

require_once TTSUNSOLAR_DIR . '/solarcore/solarcore-helpers.php';
require_once TTSUNSOLAR_DIR . '/solarcore/solarcore-breadcrumbs.php';
require_once TTSUNSOLAR_DIR . '/solarcore/solarcore-themesupport.php';
require_once TTSUNSOLAR_DIR . '/solarcore/solarcore-widgets.php';
require_once TTSUNSOLAR_DIR . '/solarcore/solarcore-enqueue.php';
require_once TTSUNSOLAR_DIR . '/solarcustom/solarcustom-register.php';

/**
 * Skip-link focus fix for older IE.
 */
function ttsunsolar_skip_link_focus_fix() {
	?>
	<script>
	/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);
	</script>
	<?php
}
add_action( 'wp_print_footer_scripts', 'ttsunsolar_skip_link_focus_fix' );
