WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

Can custom fields be used to determine specific actions upon saving a post to the database?

Which action(s) make this possible, since adding post medata seems to always occur after saving a post and thus any plugin hooking into wp_insert_post is activated before the post meta data has been added to the post.

share|improve this question
@BjornW: If you can give a few more details of you use case maybe I or someone else could whip up a small example to show you how. – MikeSchinkel Sep 1 '10 at 18:02

If you are wanting to run the function after the post meta data has been added/updated, use:

add_action( 'updated_post_meta', 'my_post_meta_function' );
share|improve this answer

If there's no complicated logic involved in updating the custom fields, you could derive the new values by grabbing their (changed) values from $_POST and combining these with their existing values from the database. Base your processing upon the resulting values.

share|improve this answer

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.