Get the author of the latest revision

I would like to display the author (username) of the latest revision of a post from inside the loop. I tried get_the_author(), which echoes the username and $post->post_author(), which returns the user_id, but both return the original post author and not the latest revisor. 1 Answer 1 Try the_modified_author() or get_the_modified_author(), this should give you … Read more

Disable revisions for a specific post type only?

Any way to disable post revision on specific post types only? 2 Answers 2 Remove the revisions property inside the supports parameter of register_post_type(). Example $args = array( // … ‘supports’ => array(‘title’,’editor’,’thumbnail’,’comments’,’revisions’) ); register_post_type(‘book’,$args); Change to: $args = array( // … ‘supports’ => array(‘title’,’editor’,’thumbnail’,’comments’) ); register_post_type(‘book’,$args);

Enabled Revisions to existing custom post type not working WordPress

I am trying to enable revisions for an existing custom post type. As the post type was already created about 2 years ago so where the post type was register I added revisions to the supports array. Earlier my code was like: $labels = array( ‘name’ => ‘Products’, ‘singular_name’ => ‘Product’, ‘all_items’ => ‘All Products’, … Read more

How to remove in the wordpress database all posts revisions except the last three?

here is the commonly recommended sql command for removing posts revisions and cleaning up the wp database: DELETE a,b,c FROM `wp_posts` a LEFT JOIN `wp_term_relationships` b ON (a.ID = b.object_id) LEFT JOIN `wp_postmeta` c ON (a.ID = c.post_id) WHERE a.post_type=”revision”; how can i modify it to keep let’s say the last 3 revisions ? 2 … Read more