Skip to content

Commit

Permalink
Use core version of template and template part post types and REST en…
Browse files Browse the repository at this point in the history
…dpoints
  • Loading branch information
talldan committed Nov 26, 2021
1 parent 753742e commit 6b40260
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/full-site-editing/template-parts.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ function gutenberg_register_template_part_post_type() {
return;
}

// If the post type has already been registered (by WordPress core), skip
// registration.
if ( post_type_exists( 'wp_template_part' ) ) {
return;
}

$labels = array(
'name' => __( 'Template Parts', 'gutenberg' ),
'singular_name' => __( 'Template Part', 'gutenberg' ),
Expand Down
6 changes: 6 additions & 0 deletions lib/full-site-editing/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ function gutenberg_register_template_post_type() {
return;
}

// If the post type has already been registered (by WordPress core), skip
// registration.
if ( post_type_exists( 'wp_template' ) ) {
return;
}

$labels = array(
'name' => __( 'Templates', 'gutenberg' ),
'singular_name' => __( 'Template', 'gutenberg' ),
Expand Down

0 comments on commit 6b40260

Please sign in to comment.