Make WordPress Core

Opened 18 months ago

Last modified 18 months ago

#57289 new defect (bug)

Allow child themes to use template parts from parent themes in Full Screen Editor

Reported by: catacaustic's profile catacaustic Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.1.1
Component: Editor Keywords: reporter-feedback
Focuses: Cc:

Description

Creating template parts in a theme for the Full Site Editor does not allow template parts from a parent theme to be used by a child theme. These will show when editing a template, and allow you to insert/update/delete them when editing templates, but an error message shows on the public-facing page - "Template part has been deleted or is unavailable: *template-name*".

All that is needed is an additional check if a child theme is active and if so check against the parent theme as well as the child theme.

Attachments (1)

1l3Zto9h.diff (249 bytes) - added by catacaustic 18 months ago.
Diff file

Download all attachments as: .zip

Change History (4)

@catacaustic
18 months ago

Diff file

#1 @catacaustic
18 months ago

Sorry, missed which file this applies to -

wp-includes\blocks\template-part.php

This ticket was mentioned in Slack in #core-test by ironprogrammer. View the logs.


18 months ago

#3 @ironprogrammer
18 months ago

  • Keywords reporter-feedback added

Welcome back to Trac, @catacaustic, and thanks for the report!

This issue looks similar to https://github.com/WordPress/gutenberg/issues/44243, where a workaround was to remove the theme name from <!-- wp:template-part -->. For instance, change:

<!-- wp:template-part {"slug":"header","tagName":"header","theme":"my-theme"} /-->

to

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

Would you mind testing to see if this also fixes the errors you're seeing? Your proposed patch may offer a solution there as well. Thank you!

Note: See TracTickets for help on using tickets.