Checking Values of Custom Fields Before Save
-
Again, scribu. A great plugin. I have run across another quirk that I hope you or someone else here could help me out with:
I have a two custom fields: ‘Rating’ and ‘Previous Rating.’ When someone edits the value of rating on the frontend, I want to check the current value of ‘Rating’ and if the value is different than the one being submitted, it should update the value of ‘Previous Rating’ with the current rating and then save the submitted value to rating. I saw a demo of hooking into wp_insert_post_data and I see that an AJAX call is being made to ajax_admin.php with my requested data. I am just not sure how it is available once I am inside wp_insert_post_data. Normally, I would look at $_POST.
Here is the code I tried: http://pastebin.com/u8H9RQp3
Any help or a point in the right direction would be appreciated.
The topic ‘Checking Values of Custom Fields Before Save’ is closed to new replies.