Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove custom registration of ˋwp_pattern_categoryˋ #8

Open
2 tasks done
carstingaxion opened this issue Oct 2, 2023 · 0 comments
Open
2 tasks done

Remove custom registration of ˋwp_pattern_categoryˋ #8

carstingaxion opened this issue Oct 2, 2023 · 0 comments

Comments

@carstingaxion
Copy link
Member

carstingaxion commented Oct 2, 2023

Tasks

  1. Needs User Documentation [Feature] Patterns [Type] Enhancement
    glendaviesnz
  2. Gutenberg Plugin [Type] Tracking Issue
    SiobhyB karmatosed
    mikachan

public static function register_wp_core_pattern_category() : void {

public static function register_wp_core_pattern_category() : void {

	if ( \taxonomy_exists( WP_CORE_PATTERN_TAX ) ) {
		return;
	}

	$args = [
		[
			'public'            => false,
			'hierarchical'      => false,
			'labels'            => [
				'name'          => _x( 'Pattern Categories', 'taxonomy general name' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
				'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
			],
			'query_var'         => false,
			'rewrite'           => false,
			'show_ui'           => false,
			'_builtin'          => true,
			'show_in_nav_menus' => false,
			'show_in_rest'      => true,
		],
	];
	\register_taxonomy( WP_CORE_PATTERN_TAX, [ 'wp_block' ], $args );
	\register_taxonomy_for_object_type( WP_CORE_PATTERN_TAX, 'wp_block' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant