forked from rtCamp/rt-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp-helpers.php
More file actions
47 lines (40 loc) · 1.27 KB
/
Copy pathwp-helpers.php
File metadata and controls
47 lines (40 loc) · 1.27 KB
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
/*
Plugin Name: wp-helpers
Plugin URI: http://rtcamp.com/
Description: This plugin contains common libs that are used in many rtcamp plugins
Version: 0.3
Author: rtcamp
Author URI: http://rtcamp.com/
*/
$rt_helper_version = '0.4';
$rt_wp_helper_path = __FILE__;
#. '/rt-wp-autoloader/class-rt-wp-autoload.php';
global $rt_wp_helper;
if ( ! isset ( $rt_wp_helper ) ) {
$rt_wp_helper = array(
'version' => $rt_helper_version, 'wp_helper_path' => $rt_wp_helper_path,
);
function rt_wp_helper_loader() {
global $rt_wp_helper;
$rt_autoloader_file = realpath( dirname( $rt_wp_helper[ 'wp_helper_path' ] ) ) . '/rt-wp-autoloader/class-rt-wp-autoload.php';
if ( file_exists( $rt_autoloader_file ) ) {
include_once $rt_autoloader_file;
}
if ( ! defined( 'WP_HELPER_FILE' ) ) {
define( 'WP_HELPER_FILE', $rt_wp_helper[ 'wp_helper_path' ] );
}
/**
* Initiate Loader class
*/
if ( class_exists( 'RT_WP_Autoload' ) ) {
$GLOBALS[ 'wp_helper_loader' ] = new RT_WP_Autoload();
}
}
add_action( 'plugins_loaded', 'rt_wp_helper_loader', 1 );
} else {
if ( version_compare( $rt_helper_version, $rt_wp_helper[ 'version' ], '>' ) ) {
$rt_wp_helper[ 'version' ] = $rt_helper_version;
$rt_wp_helper[ 'wp_helper_path' ] = $rt_wp_helper_path;
}
}