<?php
if ( ! function_exists( 'theaisle_core_dashboard_load_files' ) ) {
	function theaisle_core_dashboard_load_files() {
		require_once THEAISLE_CORE_ABS_PATH . '/core-dashboard/core-dashboard.php';
		require_once THEAISLE_CORE_ABS_PATH . '/core-dashboard/rest/include.php';
		require_once THEAISLE_CORE_ABS_PATH . '/core-dashboard/registration-rest.php';
		require_once THEAISLE_CORE_ABS_PATH . '/core-dashboard/sub-pages/sub-page.php';

		foreach (glob(THEAISLE_CORE_ABS_PATH . '/core-dashboard/sub-pages/*/load.php') as $subpages) {
			include_once $subpages;
		}
	}

	add_action('after_setup_theme', 'theaisle_core_dashboard_load_files');
}