What is the WordPress `$post` global variable and when is it populated?

WordPress Expert Easy

WordPress Expert — Easy

What is the WordPress `$post` global variable and when is it populated?

Key points

  • `$post` is not an array of all posts, but a specific object for the current post
  • It is not just the most recently created post, but the one being displayed
  • Populated during the loop, not only during admin edit screens

Ready to go further?

Related questions