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.

  • @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' );
| 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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