-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathblock-patterns.php
36 lines (35 loc) · 1.02 KB
/
block-patterns.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Overrides Core's wp-includes/block-patterns.php to add new wp_patterns taxonomy for WP 6.4.
*
* @package gutenberg
*/
/**
* Adds a new taxonomy for organizing user created patterns.
*
* Note: This should be removed when the minimum required WP version is >= 6.4.
*
* @see https://github.com/WordPress/gutenberg/pull/53163
*
* @return void
*/
function gutenberg_register_taxonomy_patterns() {
$args = array(
array(
'public' => false,
'hierarchical' => false,
'labels' => array(
'name' => _x( 'Pattern Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ),
),
'query_var' => false,
'rewrite' => false,
'show_ui' => false,
'_builtin' => true,
'show_in_nav_menus' => false,
'show_in_rest' => true,
)
);
register_taxonomy( 'wp_pattern_category', array( 'wp_block' ), $args );
}
add_action( 'init', 'gutenberg_register_taxonomy_patterns' );