-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
Introduces 'WP_Block_Template::$default' property
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,10 +253,12 @@ function _gutenberg_build_template_result_from_file( $template_file, $template_t | |
$template->title = ! empty( $template_file['title'] ) ? $template_file['title'] : $template_file['slug']; | ||
$template->status = 'publish'; | ||
$template->has_theme_file = true; | ||
$template->default = false; | ||
|
||
if ( 'wp_template' === $template_type && isset( $default_template_types[ $template_file['slug'] ] ) ) { | ||
$template->description = $default_template_types[ $template_file['slug'] ]['description']; | ||
$template->title = $default_template_types[ $template_file['slug'] ]['title']; | ||
$template->default = true; | ||
} | ||
|
||
if ( 'wp_template' === $template_type && isset( $template_file['postTypes'] ) ) { | ||
|
@@ -304,6 +306,7 @@ function _gutenberg_build_template_result_from_post( $post ) { | |
$template->title = $post->post_title; | ||
$template->status = $post->post_status; | ||
$template->has_theme_file = $has_theme_file; | ||
$template->default = false; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Mamaduka
Author
Member
|
||
|
||
if ( 'wp_template_part' === $post->post_type ) { | ||
$type_terms = get_the_terms( $post, 'wp_template_part_area' ); | ||
|
Why are all saved templates marked as "default" false, I mean If I save a template called "index", it's still the "index" template from the hierarchy and it shouldn't show in the page template selector right?
Also it feels as "default" doesn't provide the right semantics, it's hard to understand its purpose, should we find another name for this flag?