Make WordPress Core


Ignore:
Timestamp:
11/21/2022 04:48:33 PM (20 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template-utils.php

    r54831 r54860  
    504504    $template                 = new WP_Block_Template();
    505505    $template->id             = $theme . '//' . $template_file['slug'];
    506     $template->theme          = $theme;
     506    $template->theme          = ! empty( $template_file['theme'] ) ? $template_file['theme'] : $theme;
    507507    $template->content        = _inject_theme_attribute_in_block_template_content( $template_content );
    508508    $template->slug           = $template_file['slug'];
Note: See TracChangeset for help on using the changeset viewer.