I'm building a project management web app using WordPress. I want to create a kind of "news feed" on the home page so that everyone can see what the latest posts added/edited were. I need this to work with custom fields too (specifically, I'm using advancedcustomfields).
An example of what I'm trying to do:
- Rick created a new
get_post_type()calledget_the_title()onget_the_time() - Jim changed the Due Date of Client Print Ad from 3/5/13 to 3/2/13
For additions (#1 above), this is really easy. new WP_Query(array('post_type' => 'any', 'numberposts' => '-1', 'posts_per_page' => '-1', 'orderby' => 'date'))
and then loop through.
For edits (#2 above), I'm finding this to be more challenging. Obviously I can see if this is an edit, but I'm having trouble getting the exact edits. I'm thinking of doing add_action('save_post', 'insert_activity') and inserting some kind of string to post_meta, but I don't know if that's the best solution or if its redundant with capabilities already built in.
Has anyone tried to do this before? I know WordPress has the built in revision manager where you can compare revisions, but what is the best way to compare this on the front end? How does this work with custom fields?