Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#9519 closed defect (bug) (fixed)

Delete a child theme will delete parent theme

Reported by: Wupperpirat Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.8
Component: General Keywords: has-patch needs-testing
Focuses: Cc:


I'm one of the maintainers and supporters of Thematic testing a lot of child themes. Today I wanted to clean up my theme directory using the backend. Deleting one of my child themes will delete the parent theme instead.

I'm running the current 2.8 SVN version 10912 on my local machine.

Let me know if you need more details.



Attachments (2)

9519.diff (590 bytes) - added by ionfish 6 years ago.
9519.1.diff (1.4 KB) - added by ionfish 6 years ago.

Download all attachments as: .zip

Change History (8)

@ionfish6 years ago

comment:1 @DD326 years ago

  • Milestone changed from Unassigned to 2.8

So the child theme remains? Just the Parent theme gets deleted? (Looks like someone got Template vs Stylesheet mixed up)

comment:2 @ionfish6 years ago

  • Keywords has-patch needs-testing added; delete child theme child theme removed

Can you test the attached patch?

comment:3 @DD326 years ago

ionfish: Did you test that at all? It doesnt look like it'd do anything at all to me.

$_GETstylesheet? isnt passed at all, Line 197 of themes.php passes in $template, All occurences of $template related to the deletion should probably be renamed to $stylesheet

comment:4 @ionfish6 years ago

The Preview and Activate URIs both include the template and the stylesheet (now I look, the Delete one doesn't), so I based my patch on that. Here's an updated one.

@ionfish6 years ago

comment:5 @Wupperpirat6 years ago

Thanks a lot for your help .. the last 9519.1.diff is working .. I checked deletion of child themes: worked .. and I checked deletion of standard themes: worked.

Again .. thanks a lot for your help & Happy Easter!



comment:6 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10915]) Use stylesheet directory when deleting a theme so we don't accidentally delete a parent theme. Props ionfish. fixes #9519

Note: See TracTickets for help on using tickets.