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 a custom post type that hold real estate listings and I need to figure out a way to keep a record of the price of the property is listed for. For example a user lists a property for sale and then the user edits the property listing and changes the price. I need to show the price before and the new price and the date the price was changed. The price value is stored in a custom field. Doe anyone have any idea of how I can begin to tackle this issue.

I basically need to keep a record of a posts custom field and the date it was changed. If i can get an idea of how to code this I can post the code here for anyone who might find this useful.


share|improve this question
up vote 1 down vote accepted

Your best option here is to create a second Custom Field and store an Array of all the versions that have been used together with the date of the update and the user who commited the changes, acually everything you need to know.

Hook into the save_post action and compare the Value of the Custom Field with the last Value of the "HistoryArray". If it is different, push another Element into the Array and update the HistoryArray.

share|improve this answer
I'd add to this solution using an underscore for the second Custom Field (_second_field), so it doesn't shows up in the CF's list. And print the formatted value info in a Custom Meta Box (like the Revisions). – brasofilo Dec 18 '12 at 17:09
yeah, this is a good idea @brasofilo. – fischi Dec 18 '12 at 19:29

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.