<?php
/**
* 1、在这里定义了一些用到的函数和常量、变量。
* 2、框架只需要加载者一个文件就可用添加所有扩展和选项了
* https://github.com/reduxframework/redux-framework/blob/master/sample/sample-config.php
*/
// 不允许直接访问此文件。
if ( ! defined( 'ABSPATH' ) ) {
exit( '拒绝直接访问脚本.' );
}
/**
* The main class.
*/
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct script access denied.' );
}
class Unify {
public static $framework_folder='redux';
public static $template_dir_path = '';
public static $template_dir_url = '';
public static $stylesheet_dir_path = '';
public static $stylesheet_dir_url = '';
/**
* The class constructor
*
* @access private
*/
private function __construct() {
// Add a non-persistent cache group.
wp_cache_add_non_persistent_groups( 'Unify' );
// Set static vars.
if ( '' === self::$template_dir_path ) {
self::$template_dir_path = wp_normalize_path( get_template_directory() );
}
if ( '' === self::$template_dir_url ) {
self::$template_dir_url = get_template_directory_uri();
}
if ( '' === self::$stylesheet_dir_path ) {
self::$stylesheet_dir_path = wp_normalize_path( get_stylesheet_directory() );
}
if ( '' === self::$stylesheet_dir_url ) {
self::$stylesheet_dir_url = get_stylesheet_directory_uri();
}
}
}
//include_once wp_normalize_path( get_template_directory() . '/redux/inc/class-Unify.php' );
/**
* 包含路径函数常量文件.
*/
//定义框架目录为当前启用的主题目录里的redux,如果想自定义文件夹请修改redux为自己的文件夹名称
//include_once wp_normalize_path( get_template_directory() .'$framework_folder'.' /inc/path-init.php' );
//include_once wp_normalize_path( get_template_directory() .'/redux/inc/path-init.php' );
//include_once Unify::$template_dir_path . '/redux/inc/path-init.php';
//include_once Unify::$framework_dir_path . '/inc/path-init.php';
//include_once $framework_dir_path . "/inc/path-init.php";
//include_once Unify::$template_dir_path . '/redux/path-init.php';
// Load the TGM init if it exists
if ( file_exists( dirname( __FILE__ ) . '/tgm/tgm-init.php' ) ) {
require_once dirname( __FILE__ ) . '/tgm/tgm-init.php';
}
// Load the embedded Redux Framework
if ( file_exists( dirname( __FILE__ ).'/framework/framework.php' ) ) {
require_once dirname(__FILE__).'/framework/framework.php';
}
// Load the theme/plugin options
if ( file_exists( dirname( __FILE__ ) . '/inc/options-init.php' ) ) {
require_once dirname( __FILE__ ) . '/inc/options-init.php';
}
// Load Redux extensions
if ( file_exists( dirname( __FILE__ ) . '/extensions/extensions-init.php' ) ) {
require_once dirname( __FILE__ ) . '/extensions/extensions-init.php';
}