Editor: Add block theme infrastructure

Adds the required infrastructure to render block-based themes. This is sourced
from the Gutenberg plugin.

Fixes #54335.
Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya.


git-svn-id: https://develop.svn.wordpress.org/trunk@52062 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Robert Anderson
2021-11-08 23:09:53 +00:00
parent 81b29a2865
commit 39e33bed83
18 changed files with 1828 additions and 44 deletions

View File

@@ -18,6 +18,7 @@
* avoid registering rewrite rules before the {@see 'init'} action.
*
* @since 2.8.0
* @since 5.9.0 Added `'wp_template_part_area'` taxonomy.
*
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
*/
@@ -175,7 +176,7 @@ function create_initial_taxonomies() {
register_taxonomy(
'wp_theme',
array( 'wp_template', 'wp_global_styles' ),
array( 'wp_template', 'wp_template_part', 'wp_global_styles' ),
array(
'public' => false,
'hierarchical' => false,
@@ -191,6 +192,25 @@ function create_initial_taxonomies() {
'show_in_rest' => false,
)
);
register_taxonomy(
'wp_template_part_area',
array( 'wp_template_part' ),
array(
'public' => false,
'hierarchical' => false,
'labels' => array(
'name' => __( 'Template Part Areas' ),
'singular_name' => __( 'Template Part Area' ),
),
'query_var' => false,
'rewrite' => false,
'show_ui' => false,
'_builtin' => true,
'show_in_nav_menus' => false,
'show_in_rest' => false,
)
);
}
/**