I have created a custom Post Type, and Registered it.
Can someone help me how to enable revisions to Custom Post type?
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
When you register your CPT, you need to manually add support for revisions. Only title and editor are set as defaults. Check out the codex. So if you need to enable revisions, you need to add it like this
'supports' => array( 'title', 'editor', 'revisions' ),
$args = array() when registering your CPT.
Just for info, here are the other arguments you can pass to ‘supports’
'title' 'editor' (content) 'author' 'thumbnail' (featured image, current theme must also support post-thumbnails) 'excerpt' 'trackbacks' 'custom-fields' 'comments' (also will see comment count balloon on edit screen) 'revisions' (will store revisions) 'page-attributes' (menu order, hierarchical must be true to show Parent option) 'post-formats' add post formats, see Post Formats
Thanks to @jammypeach, it is important to know, the revision metabox will not show up until there are actually revisions for the post. If there are no revisions, the revision meta box will not show