前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >每天一个WordPress文件:wp-load.php

每天一个WordPress文件:wp-load.php

作者头像
Denis
发布2023-04-15 10:14:55
3500
发布2023-04-15 10:14:55
举报
文章被收录于专栏:WordPress果酱WordPress果酱

在上一篇文章中,我们知道,wp-blog-header.php 通过 wp-load.php 先后把 wp-config.php,wp-setting.php,classes.php,fucntions.php, query.php 等文件加载进来,并建立了三个全局变量,wp_the_query,wp_rewrite 和

那么现在让我们分析下 wp-load.php:

代码语言:javascript
复制
先看它的注释:
 /**
  * Bootstrap file for setting the ABSPATH constant
  * and loading the wp-config.php file. The wp-config.php
  * file will then load the wp-settings.php file, which
  * will then set up the WordPress environment.
  *
  * If the wp-config.php file is not found then an error
  * will be displayed asking the visitor to set up the
  * wp-config.php file.
  *
  * Will also search for wp-config.php in WordPress' parent
  * directory to allow the WordPress directory to remain
  * untouched.
  *
  */

首先 wp-load.php 是 WordPress 的引导文件,它会首先创建 ABSPATH 这个 WordPress 最重要的常量,然后加载 wp-config.php 文件,wp-config.php 文件在加载 wp-settings.php 文件,最终创建 WordPress 环境。

wp-load.php 还会在 WordPress 上级目录去查找 wp-config.php 文件,这样可以保证 WordPress 目录不被改动。

如果 wp-config.php 文件不存在,wp-load.php 就会让访问者去设置和创建 wp-config.php 文件,就是 WordPress 的安装过程。


本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档