WordPress Global Variables

Usage of global variables in WordPress is easy syntax, but it also makes breaking of functionalities easier while using them. This is an effort to document all the global variables used by WordPress and any possible documentation for it to enable wiser use in plugins and templates. A generic rule to follow while using global variables in plugins and themes is that values should only be read from them and they should never be written. Values will be written to them in the WordPress code and never in the plugins or themes. This documentation is good for WordPress 2.0.1.

You can subscribe to the WordPress Global Variables feed to receive updates on the global variables.

This post will be continuously updated:

Technorati tags: , ,

Copyright Abhijit Nadgouda

Discussion [Participate or Link]

  1. Red light in a blue box » Global vars in Wordpress said:

    […] There seems to be little documentation on certain aspects of WordPress. One such under-documented thing is the global variables available. Luckily, Abhijit Nadgouda has complied a list of the WordPress global variables, the list links to any known documentation. […]

  2. **** FUNKABLOG 64 BASIC V2 **** » Blog Archive » Signs your PHP needs refactoring said:

    […] first sign is a huge pet peeve of mine: the use of global variables. I’m looking at you, Matt Mullenweg. Tags: php, refactoring, wordpress, […]

  3. Weblog Tools Collection » Blog Archive » Global Variables and the WordPress Loop said:

    […] the_post() has been called, you have access to a multitude of template tags and global variables. Below are some examples of template tags that are now […]

  4. RiverlandPages » Global Variables and the WordPress Loop said:

    […] the_post() has been called, you have access to a multitude of template tags and global variables. Below are some examples of template tags that are now […]

  5. Sudar said:

    Thanks for the list. It will be really very helpful to plugin authors like me.


  6. Mark said:

    Thanks a bunch, very useful!!!

  7. WordPress????????? said:

    […] WordPress Global Variables iface thoughts […]

  8. ?????JOE? » Blog Archive » (?)????? WordPress ??? said:

    […] ? the_post() ????????????????????????????????????????????? […]

  9. WordPress????~????~ - typista said:

    […] http://ifacethoughts.net/2006/02/25/wordpress-global-variables/ ? […]

  10. WordPress ???????? said:

    […] ? the_post() ?????????????????????????? […]

  11. Word Press???????? | My Footsteps said:

    […] ?????????????????? ifacethoughts.net […]

  12. WordPress ???????? | ?????? said:

    […] ? the_post() ?????????????????????????? […]

  13. Hello world? | TodayBeta said:

    […] the_post() ?????????????????????????? […]

  14. Sung Tyndal said:

    As a newcomer in this field I am constantly on the lookout for insightful content on the subject. Your blog has filled my need to a great extent.

  15. CYASOFT Blog | Blog | WordPress Global Variables (updating) said:

    […] http://ifacethoughts.net/2006/02/25/wordpress-global-variables/ […]

  16. Michael Fokken said:

    What about comment_depth?

  17. WordPress,???????????????????????? | ???? said:

    […] ? the_post() ?????????????????????????? […]

  18. WordPress,?????????????????????? | ???? said:

    […] ? the_post() ?????????????????????????? […]

  19. WordPress,?????????????????????? | ???? said:

    […] ? the_post() ?????????????????????????? […]

  20. WordPreas???????? « redcocker's notebook said:

    […] WordPress Global Variables […]

  21. $post_name said:

    […] I have no idea where $post_name is assigned. It's not a global variable, I checked it out here: http://ifacethoughts.net/2006/02/25/wordpress-global-variables/ Any ideas? I'm thinking it's in a core file somewhere. Reply With Quote + […]

  22. WordPress,?????????????????????? – ? said:

    […] ? the_post() ?????????????????????????? […]

  23. WordPress ???????? | ???? said:

    […] ? the_post() ?????????????????????????? […]

  24. WordPress ???????? | How && Why said:

    […] ? the_post() ?????????????????????????? […]

  25. Abhijit Nadgouda’s List of WordPress Global Variables « Lorelle on WordPress said:

    […] can see the full list of WordPress Global Variables by Nadgouda to find new articles and the ones I missed, and find more technical information about the various […]

  26. wordpress???WordPress ???????? – ??? said:

    […] have_posts() ? the_post()???????? WP_Query ????have_posts????????????????????? WordPress ??????????????????????????????????? the_post ??????????????? $post ??????? the_post???????????????????????????????????????????-???????????? WordPress ?? $post ??????????????????the_post() ???????????????????????????????????????????the_author?????????the_title???????????the_content?????????the_permalink??????????? URL?the_ID?????? ID????????????????????? authordata? […]

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.



Abhijit Nadgouda
iface Consulting
+91 9819820312
My bookmarks


This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.