-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathayecode-ui-loader.php
46 lines (42 loc) · 1.15 KB
/
ayecode-ui-loader.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* This is a file takes advantage of anonymous functions to to load the latest version of the AyeCode UI Settings.
*/
/**
* Bail if we are not in WP.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Set the version only if its the current newest while loading.
*/
add_action('after_setup_theme', function () {
global $ayecode_ui_version,$ayecode_ui_file_key;
$this_version = "0.2.31";
if(empty($ayecode_ui_version) || version_compare($this_version , $ayecode_ui_version, '>')){
$ayecode_ui_version = $this_version ;
$ayecode_ui_file_key = wp_hash( __FILE__ );
}
},0);
/**
* Load this version of WP Bootstrap Settings only if the file hash is the current one.
*/
add_action('after_setup_theme', function () {
global $ayecode_ui_file_key;
if($ayecode_ui_file_key && $ayecode_ui_file_key == wp_hash( __FILE__ )){
include_once( dirname( __FILE__ ) . '/includes/class-aui.php' );
include_once( dirname( __FILE__ ) . '/includes/ayecode-ui-settings.php' );
}
},1);
/**
* Add the function that calls the class.
*/
if(!function_exists('aui')){
function aui(){
if(!class_exists("AUI",false)){
return false;
}
return AUI::instance();
}
}