mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Site Editor: Show correct theme per template or template part.
Child themes inherit templates and template parts from the parent theme. In Site Editor, the "Added by" column for a template defaults to displaying the child theme, even though it is inherited from the parent, creating confusion as to where the actual templates are located. This commit ensures that the parent theme is correctly displayed in that scenario. Follow-up to [51003], [52062]. Props ptahdunbar, WoutPitje, petaryoast, costdev, poena, audrasjb, SergeyBiryukov. Fixes #55437. git-svn-id: https://develop.svn.wordpress.org/trunk@54860 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -503,7 +503,7 @@ function _build_block_template_result_from_file( $template_file, $template_type
|
||||
|
||||
$template = new WP_Block_Template();
|
||||
$template->id = $theme . '//' . $template_file['slug'];
|
||||
$template->theme = $theme;
|
||||
$template->theme = ! empty( $template_file['theme'] ) ? $template_file['theme'] : $theme;
|
||||
$template->content = _inject_theme_attribute_in_block_template_content( $template_content );
|
||||
$template->slug = $template_file['slug'];
|
||||
$template->source = 'theme';
|
||||
|
||||
Reference in New Issue
Block a user