I want to embed an Eventbrite event in a CPT.
I can’t seem to do it because either:
1) the code from the widget (see private post below) doesn’t display, or
2) I can’t edit the CPT using Gutenberg.
I know that I “just” need to enable show_in_rest for the CPT to show Gutenberg but I don’t know how/where to do that.
I did find the following code on developers.wordpress but I’m not sure how or where to implement or if it will work:
/**
* Add REST API support to an already registered post type.
*/
add_filter( ‘register_post_type_args’, ‘my_post_type_args’, 10, 2 );
function my_post_type_args( $args, $post_type ) {
if ( ‘book’ === $post_type ) {
$args[‘show_in_rest’] = true;
// Optionally customize the rest_base or rest_controller_class
$args[‘rest_base’] = ‘books’;
$args[‘rest_controller_class’] = ‘WP_REST_Posts_Controller’;
}
return $args;
}
How can I sort this out?