<?php
// 不允许直接访问此文件。
if ( ! defined( 'ABSPATH' ) ) {
exit( '拒绝直接访问此脚本.' );
}
/**
* 定义框架常用的几个路径,你也可以添加自己的路径在此
* 注释版:https://gitee.com/jiuciyu/wordpress-funcs/tree/master
*/
class Unify {
/**
* The stylesheet directory URL.
*
* @static
* @access public
* @var string
*/
public static $framework_dir_path = '';
/**
* The stylesheet directory URL.
*
* @static
* @access public
* @var string
*/
public static $framework_dir_url = '';
/**
* The template directory path.
*
* @static
* @access public
* @var string
*/
public static $template_dir_path = '';
/**
* The template directory URL.
*
* @static
* @access public
* @var string
*/
public static $template_dir_url = '';
/**
* The stylesheet directory path.
*
* @static
* @access public
* @var string
*/
public static $stylesheet_dir_path = '';
/**
* The stylesheet directory URL.
*
* @static
* @access public
* @var string
*/
public static $stylesheet_dir_url = '';
}
private function __construct() {
// 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();
}
}
/**
* Define basic properties in the Unify class.
*/
Unify::$framework_dir_path = wp_normalize_path( get_template_directory('/redux/') );
Unify::$framework_dir_url = get_template_directory_uri('/redux/');
Unify::$template_dir_path = wp_normalize_path( get_template_directory() );
Unify::$template_dir_url = get_template_directory_uri();
Unify::$stylesheet_dir_path = wp_normalize_path( get_stylesheet_directory() );
Unify::$stylesheet_dir_url = get_stylesheet_directory_uri();
/**
* 定义框架定义基本性质
//定义框架目录为当前启用的主题目录里的redux,如果想自定义文件夹请修改redux为自己的文件夹名称
$framework_dir_path = wp_normalize_path( get_template_directory('/redux/') );
$framework_dir_url = get_template_directory_uri('/redux/');
$template_dir_path = wp_normalize_path( get_template_directory() );
$template_dir_url = get_template_directory_uri();
$stylesheet_dir_path = wp_normalize_path( get_stylesheet_directory() );
$stylesheet_dir_url = get_stylesheet_directory_uri();
$plugin_dir_path = wp_normalize_path( plugin_dir_path( __FILE__ ) );
$plugin_dir_url = plugin_dir_url( __FILE__ );
*/
pach
最新推荐文章于 2021-06-26 18:54:37 发布