id

ID of the current post in the WordPress loop or the post being displayed is stored in this global variable. It is set in the setup_postdata($post) defined in [wordpress root folder]/wp-includes/functions.php.

WordPress provides the function the_ID() that can be used inside the WordPress loop to display the post ID. However, the plugin and theme authors can access this global variable to access the post ID. It can be used to get a post using get_postdata($postid).

Back to full list of global variables.

Technorati tags: , ,

Advertisements

One Response to “id”


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: