Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created July 22, 2021 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/ece375ff854819cf900f91435ee67c76 to your computer and use it in GitHub Desktop.
Save Pebblo/ece375ff854819cf900f91435ee67c76 to your computer and use it in GitHub Desktop.
Set the espresso_events post type show_in_rest arg to true.
<?php // Please do not include the opening PHP tag if you already have one.
function tw_ee_set_show_in_rest_on_espresso_events( $args, $post_type ) {
if ( 'espresso_events' === $post_type ) {
$args['show_in_rest'] = true;
}
return $args;
}
add_filter( 'register_post_type_args', 'tw_ee_set_show_in_rest_on_espresso_events', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment