How to disable Gutenberg for specific post types

WordPress 5 isn’t far off now, and it ships with Gutenberg, the brand new content editor. If you want to only allow the classic editor for certain post types, then add the code below to your theme. In this example, Gutenberg is disabled when editing pages.