Title: Allowing Gutenberg plugin
Last modified: February 16, 2018

---

# Allowing Gutenberg plugin

 *  [Aitor Méndez](https://wordpress.org/support/users/aitormendez/)
 * (@aitormendez)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/allowing-gutenberg-plugin-3/)
 * Hi, I’m trying to add event CPT to REST API, this way: [Adding REST API Support To Existing Content Types](https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/#adding-rest-api-support-to-existing-content-types)
   with no luck.
 * When I try this code:
 *     ```
       /**
        * Add REST API support to an already registered post type.
        */
       add_action( 'init', 'my_custom_post_type_rest_support', 25 );
       function my_custom_post_type_rest_support() {
         global $wp_post_types;
   
         //be sure to set this to the name of your post type!
         $post_type_name = 'event';
         if( isset( $wp_post_types[ $post_type_name ] ) ) {
           $wp_post_types[$post_type_name]->show_in_rest = true;
           // Optionally customize the rest_base or controller class
           $wp_post_types[$post_type_name]->rest_base = $post_type_name;
           $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
         }
       }
       ```
   
 * I get some errors:
 * [https://www.dropbox.com/s/iuchg5k02p3i7qm/Captura%20de%20pantalla%202018-02-15%2019.20.37.png?dl=0](https://www.dropbox.com/s/iuchg5k02p3i7qm/Captura%20de%20pantalla%202018-02-15%2019.20.37.png?dl=0)
 * Is it possible to add Gutemberg editor to event CPT?
 * Thank you in advance.

The topic ‘Allowing Gutenberg plugin’ is closed to new replies.

 * ![](https://ps.w.org/event-organiser/assets/icon-256x256.png?rev=978123)
 * [Event Organiser](https://wordpress.org/plugins/event-organiser/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-organiser/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-organiser/)
 * [Active Topics](https://wordpress.org/support/plugin/event-organiser/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-organiser/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-organiser/reviews/)

## Tags

 * [gutemberg](https://wordpress.org/support/topic-tag/gutemberg/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)

 * 0 replies
 * 1 participant
 * Last reply from: [Aitor Méndez](https://wordpress.org/support/users/aitormendez/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/allowing-gutenberg-plugin-3/)
 * Status: not resolved