I have a custom meta box which I would like to use to report on the markup of the current post or page (number of words, number of heading tags, etc).
How can I obtain the post content into memory in order to parse and report on its content inside the meta box?
The callback for a meta box gets the current object (post, comment, link, … depending on what you’re editing) passed as the first parameter. So in your meta box handler you can read this first argument and access it’s
post_content
to get the content.