Skip to content

Gutenberg hide built-in term meta box #29

@normanlolx

Description

@normanlolx

In WP 5 with Gutenberg remove_meta_box doesn't seem to have any effect anymore.

The following workaround from WordPress/gutenberg#6912 (comment) might temporarily fix this. I slightly adapted it to hide the post_tag metabox instead of the category meta box from the original snippet.

/**
 * Disable display of Gutenberg Post Setting UI for a specific
 * taxonomy. While this isn't the official API for this need,
 * it works for now because only Gutenberg is dependent on the
 * REST API response.
 */
add_filter( 'rest_prepare_taxonomy', function( $response, $taxonomy ){
	if ( 'post_tag' === $taxonomy->name ) {
		$response->data['visibility']['show_ui'] = false;
	}
	return $response;
}, 10, 2 );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions