Per Post Type Revision Numbers

  1. Remove the action 'wp_save_post_revision' from 'pre_post_update'. It is set per default in wp-includes/default-filters.php with the default priority (10).

  2. Add your own function to this hook. You get the $post_ID as parameter, so detecting the post type is easy.

  3. In your callback copy the code from wp_save_post_revision() but use the constant WP_POST_REVISIONS for the post type post only, and use different values for other post types. Not sure if it is possible to pass extra values in register_post_type()

Leave a Comment