Global Variables


目录

Introduction

WordPress-specific global variables are used throughout WordPress code for various reasons. Almost all data that WordPress generates can be found in a global variable.

Note that it’s best to use the appropriate API functions when available, instead of modifying globals directly.

To access a global variable in your code, you first need to globalize the variable with global $variable;.

Accessing other globals besides the ones listed below is not recommended.

Inside the Loop variables

While inside the loop, these globals are set, containing information about the current post being processed.

Browser Detection Booleans

These globals store data about which browser the user is on.

Web Server Detection Booleans

These globals store data about which web server WordPress is running on.

Version Variables

Misc

Admin Globals


版本号 #2
由 壳壳虫 创建于 2026-10-31 18:06:38 UTC
由 壳壳虫 更新于 2026-10-31 18:06:39 UTC