重构
PHP
<?php
/**
* QiMeng Theme Functions
*
* 核心入口文件:定义常量、加载核心类和业务模块
*/
if ( ! defined( 'ABSPATH' ) ) { exit; }
define( 'QIMENG_VERSION', '5.3' );
define( 'QIMENG_DIR', get_template_directory() );
require_once QIMENG_DIR . '/inc/core/bootstrap.php';
require_once QIMENG_DIR . '/inc/edition/authorization.php';
if ( function_exists( 'qimeng_authorization_maybe_serve_domain_challenge' ) ) {
qimeng_authorization_maybe_serve_domain_challenge();
}
if ( function_exists( 'qimeng_authorization_guard_frontend' ) ) {
qimeng_authorization_guard_frontend();
}
$template_uri = get_template_directory_uri();
if ( is_ssl() || ( ! empty( $_SERVER['HTTPS'] ) && 'off' !== $_SERVER['HTTPS'] ) ) {
$template_uri = set_url_scheme( $template_uri, 'https' );
}
$template_uri = qimeng_bootstrap_rewrite_url_to_runtime_origin( $template_uri );
define( 'QIMENG_URI', $template_uri );
qimeng_register_fatal_shutdown_logger();
require_once QIMENG_DIR . '/inc/edition/feature-map.php';
require_once QIMENG_DIR . '/inc/helpers/ajax.php';
require_once QIMENG_DIR . '/inc/core/class-environment.php';
require_once QIMENG_DIR . '/inc/core/class-loader.php';
$loader = Qimeng_Loader::get_instance();
require_once QIMENG_DIR . '/inc/theme-bootstrap.php';
还没有人评论,快来抢沙发吧~