Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Post revisions don't save or show up for all custom post types

My website makes use of a number of custom post types as well as the traditional "posts" and "pages" types. For all "posts" and "pages" revisions show up as they should, with a history of edits visible, the option to compare posts, and so on. For all custom post types, I have no revision history at all. I've enabled revisions when defining each of these post types in functions.php, so on each of these post types I get a blank tab that says "Revisions" but does not display or collect any revisions data.

I'm at a loss for how to fix this and any help would be appreciated!

Thanks in advance for any assistance.

I could post my functions.php file if it helps solve this... just ask.

like image 687
user1695870 Avatar asked Sep 25 '12 00:09

user1695870


People also ask

How do you show categories in custom post type?

To display your custom post types on the same category page as your default posts, you need to add this code into your theme's functions. php or a site-specific plugin. $post_type = array ( 'nav_menu_item' , 'post' , 'movies' ); // don't forget nav_menu_item to allow menus to work!

Does WordPress keep version history?

What Is the WordPress Revision History Feature? Did you know WordPress automatically saves all the changes you make to your posts. You can undo those changes and go back to an earlier version at any time. This feature is called WordPress Revisions and it has been available since WordPress 2.6.


1 Answers

I know this is an old Q, but just had the same problem and fixed it...

In your custom post type args array (in functions.php) add 'revisions' to the 'supports' array:

$args = array(....., 'supports' => array(..., 'revisions'),......);

Note however that this wont take effect for old pages of this post type, just new ones created from now on

If you're doing anything to do with custom post types, this article is awesome.

like image 190
hobailey Avatar answered Oct 09 '22 07:10

hobailey