#40820 closed defect (bug) (fixed)
Child theme should appear as broken if parent is itself
Reported by: | davilera | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | minor | Version: | 4.7.5 |
Component: | Themes | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Child themes are defined as such if they include the Template
header in style.css
. In general, if the parent template can't be found, WordPress reports the theme as Broken and tells the user to install the missing parent theme.
However, if the Template
header is the theme itself, no errors are reported (WordPress can find the "parent" theme, because it's itself). The resulting behavior is weird and unexpected:
- If there are other themes available, WordPress uses one as the parent theme (I don't know which criteria is used for selecting one or the other).
- If there aren't, the front-end is completely blank (but this might depend on the amount of code included in the child theme).
Such an (invalid) child theme should be reported as Broken. For instance, the following message could be shown: The theme defines itself as its parent theme. Please fix the "Template" header.
Attachments (3)
Change History (12)
#1
@
7 years ago
- Keywords has-patch needs-testing added
- Resolution set to invalid
- Severity changed from normal to minor
- Status changed from new to closed
#3
@
7 years ago
- Focuses template removed
- Keywords has-unit-tests added
I just uploaded a new patch 40820.diff along with a Unit Test.
#5
@
7 years ago
- Keywords needs-testing removed
- Milestone changed from Awaiting Review to 4.9
40820.2.diff is an updated patch that adjusts other theme unit tests because of that new test theme.
Adds an extra check to make sure that the parent theme of a child theme is not the child theme itself.