Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 63222ba

Browse files
committed
Set Template part area to 'uncategorized'
1 parent a730af0 commit 63222ba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Utils/BlockTemplateUtils.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ public static function gutenberg_build_template_result_from_post( $post ) {
109109
$template->has_theme_file = $has_theme_file;
110110
$template->is_custom = true;
111111
$template->post_types = array(); // Don't appear in any Edit Post template selector dropdown.
112+
if ( 'wp_template_part' === $post->post_type ) {
113+
$template->area = 'uncategorized';
114+
}
112115

113116
return $template;
114117
}
@@ -137,6 +140,9 @@ public static function gutenberg_build_template_result_from_file( $template_file
137140
$template->has_theme_file = true;
138141
$template->is_custom = false; // Templates loaded from the filesystem aren't custom, ones that have been edited and loaded from the DB are.
139142
$template->post_types = array(); // Don't appear in any Edit Post template selector dropdown.
143+
if ( 'wp_template_part' === $template_type ) {
144+
$template->area = 'uncategorized';
145+
}
140146
return $template;
141147
}
142148

0 commit comments

Comments
 (0)