pach

<?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__ );
	*/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值