diff --git a/lib/full-site-editing/template-parts.php b/lib/full-site-editing/template-parts.php index 77ef42d59c03e..7f815922d699d 100644 --- a/lib/full-site-editing/template-parts.php +++ b/lib/full-site-editing/template-parts.php @@ -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' ), diff --git a/lib/full-site-editing/templates.php b/lib/full-site-editing/templates.php index 051d69647da11..58778ae3c5b1c 100644 --- a/lib/full-site-editing/templates.php +++ b/lib/full-site-editing/templates.php @@ -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' ),