WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following action callback set up:

function abc_save_post($post_id, $post)
    // do stuff

    echo '<pre>'.print_r($post,true).'</pre>';
add_action('save_post', 'abc_save_post', 10, 2);

The thing is that $post is a very trimmed down version of $_POST and is missing lots of data that I want to get at. How can I get more data into $post?

share|improve this question
up vote 1 down vote accepted

Simply use the post ID, provided by $post_id (and stored at $post->ID) to use the various functions WordPress provides to get any extra data related to that post (get_the_terms,get_post_meta etc).

Performance wise you suffer no loss by using these functions as opposed to trying to force more data into the $post object (probably the reverse in fact), since WordPress caches data related to posts (such as taxonomy terms, post meta,...)

share|improve this answer
amazing - thank you so much! – Matt Potts Apr 4 '12 at 10:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.