| 1 |
<?php |
| 2 |
/** |
| 3 |
* Loader for the ThemeIsleSDK |
| 4 |
* |
| 5 |
* Logic for loading always the latest SDK from the installed themes/plugins. |
| 6 |
* |
| 7 |
* @package ThemeIsleSDK |
| 8 |
* @copyright Copyright (c) 2017, Marius Cristea |
| 9 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 10 |
* @since 1.1.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
// Current SDK version and path. |
| 14 |
$themeisle_sdk_version = '2.1.0'; |
| 15 |
$themeisle_sdk_path = dirname( __FILE__ ); |
| 16 |
|
| 17 |
global $themeisle_sdk_max_version; |
| 18 |
global $themeisle_sdk_max_path; |
| 19 |
|
| 20 |
if ( version_compare( $themeisle_sdk_version, $themeisle_sdk_max_version ) >= 0 ) { |
| 21 |
$themeisle_sdk_max_version = $themeisle_sdk_version; |
| 22 |
$themeisle_sdk_max_path = $themeisle_sdk_path; |
| 23 |
} |
| 24 |
|
| 25 |
// load the latest sdk version from the active Themeisle products |
| 26 |
if ( ! function_exists( 'themeisle_sdk_load_latest' ) ) : |
| 27 |
/** |
| 28 |
* Always load the latest sdk version. |
| 29 |
*/ |
| 30 |
function themeisle_sdk_load_latest() { |
| 31 |
global $themeisle_sdk_max_path; |
| 32 |
require_once $themeisle_sdk_max_path . '/start.php'; |
| 33 |
} |
| 34 |
endif; |
| 35 |
add_action( 'init', 'themeisle_sdk_load_latest' ); |
| 36 |
|