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 25, 2021
1 parent e0a4bd8 commit 6d9c718
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
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
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 6d9c718

Please sign in to comment.