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:
- $admin_page_hooks
- $ajax_results
- $all_links
- $allowedposttags
- $allowedtags
- $authordata
- $bgcolor
- $cache_categories
- $cache_lastcommentmodified
- $cache_lastpostdate
- $cache_lastpostmodified
- $cache_userdata
- $category_cache
- $class
- $comment
- $comment_cache
- $comment_count_cache
- $commentdata
- $current_user
- $day
- $debug
- $descriptions
- $error
- $feeds
- $id
- $is_apache
- $is_IIS
- $is_macIE
- $is_winIE
- $l10n
- $locale
- $link
- $m
- $map
- $max_num_pages
- $menu
- $mode
- $month
- $month_abbrev
- $monthnum
- $more
- $multipage
- $names
- $newday
- $numpages
- $page
- $page_cache
- $paged
- $pagenow
- $pages
- $parent_file
- $preview
- $previousday
- $previousweekday
- $plugin_page
- $post
- $post_cache
- $post_default_category
- $post_default_title
- $post_meta_cache
- $postc
- $postdata
- $posts
- $posts_per_page
- $previousday
- $request
- $result
- $richedit
- $single
- $submenu
- $table_prefix
- $targets
- $timedifference
- $timestart
- $timeend
- $updated_timestamp
- $urls
- $user_ID
- $user_email
- $user_identity
- $user_level
- $user_login
- $user_pass_md5
- $user_url
- $weekday
- $weekday_abbrev
- $weekday_initial
- $withcomments
- $wp
- $wp_broken_themes
- $wp_db_version
- $wp_did_header
- $wp_did_template_redirect
- $wp_file_description
- $wp_filter
- $wp_importers
- $wp_plugins
- $wp_themes
- $wp_object_cache
- $wp_query
- $wp_queries
- $wp_rewrite
- $wp_roles
- $wp_similiesreplace
- $wp_smiliessearch
- $wp_version
- $wpcommentspopupfile
- $wpcommentsjavascript
- $wpdb
Technorati tags: wordpress, global variables, plugins
Copyright Abhijit Nadgouda



May 13th, 2006 at 12:06 pm
[...] 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. [...]
June 5th, 2007 at 11:05 pm
[...] 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, [...]
June 6th, 2007 at 3:11 pm
[...] 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 [...]
June 17th, 2007 at 6:17 am
[...] 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 [...]
August 5th, 2007 at 12:47 pm
Thanks for the list. It will be really very helpful to plugin authors like me.
Regards
Sudar
January 21st, 2008 at 7:28 am
Thanks a bunch, very useful!!!
May 5th, 2008 at 9:29 am
[...] Wordpress Global Variables iface thoughts [...]
August 11th, 2008 at 7:46 am
[...] ? the_post() ????????????????????????????????????????????? [...]
November 19th, 2008 at 8:32 pm
[...] http://ifacethoughts.net/2006/02/25/wordpress-global-variables/ ? [...]