sample blog-1

Global variables are used throughout the WordPress source code for several reasons. One reason is to easily allow the use of Singletons. Some of them are historical and are needed to maintain backward compatibility with previous versions of WordPress and of PHP. Others are rarely used or will soon be deprecated.

This is a jumping off point for a short and a long description of each global variable used in WordPress source code. It probably is not an exhaustive or authoritative list, though one day that may change.

This page is really meant to be an aid in simplifying the WordPress source code Inline_Documentation. Instead of littering the source code Inline_Documentation with many (sometimes erroneous) definitions of each global variable this page will act as one easily updated central location. Think of it as a Glossary for source code global variables.

Global variables are discussed in detail in the PHP Manual. In the WordPress source code most global variables should be considered read-only, but that is not an enforced rule. As a general rule, you should try to avoid changing the value of a global variable without a darn good reason to do so.

Leave a Reply

Your email address will not be published.