How To Remove Duplicate Event Type Meta Box While Using Gutenberg Editor

How To Remove Duplicate Event Type Meta Box While Using Gutenberg Editor

In order to remove a duplicate event type meta box while using Gutenberg editor, you need to follow the below mentioned steps:

  1. Open your child theme.
  2. Enter the following code in your functions.php file.
  1. add_filter( 'rest_prepare_taxonomy', 'wpem_hide_event_type_metabox', 10, 2 );
  2. function wpem_hide_event_type_metabox( $response, $taxonomy )
  3. {
  4.     if ( 'event_listing_type' === $taxonomy->name )     
  5. {
  6.         $response->data['visibility']['show_ui'] = false;
  7.     }     
  8.     return $response;
  9. }
Save changes.