Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adds Gutenberg support to events in the Theater for WordPress plugin. Add the snippet below to the functions.php of your (child) theme.
<?php
/**
* Adds Gutenberg support to events in the Theater for WordPress plugin.
*
* @param array $post_type_args The current settings for the events post type (wp_theatre_prod).
* @return array The new settings for the events post type.
*/
function wpt_add_gutenberg_support( $post_type_args ) {
$post_type_args[ 'show_in_rest' ] = true;
return $post_type_args;
}
add_filter( 'wpt/setup/post_type/args/?post_type=wp_theatre_prod', 'wpt_add_gutenberg_support' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment