WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 4 weeks ago

#26586 new enhancement

Multisite enhancement: Tool to update the parent theme across multiple sites

Reported by: yurivictor Owned by:
Milestone: Awaiting Review Priority: low
Severity: minor Version: 3.8
Component: Themes Keywords:
Focuses: multisite Cc:

Description

In multisite, say I want to update a bunch of sites to use twentyfourteen as a parent theme since twentythirteen is so last year, but I have a child theme for all my awesome share tools and adsplosions and super big nav.

If I change Template in my child theme's style.css to twentyfourteen, like so

/**
 * Theme name: Child theme
 * Template: twentyfourteen 
 */

It doesn't update to twentyfourteen. It would be nice if it did.

Instead you have to go to Network Admin and change the template settings to twentyfourteen on each site individually. Or write a MySQL script or whatever.

Maybe this is intentional for security or something, but it would still be nice to have a tool to update the parent theme across multiple sites.

Change History (4)

comment:1 nacin4 months ago

  • Priority changed from normal to low
  • Severity changed from normal to minor

It's not security, but rather, how this data is stored. And it's not an easy fix. 'stylesheet' and 'template' (parent) are both stored in the options table. If a theme changes states, the options table gets out of sync. We don't actually query style.css each pageload (doing so would be too much work), but we do on themes.php. I agree it would be nice if we detected and fixed this, but one of the issues is multisite doesn't actually know where a theme is active. It needs to look through every site.

Ultimately, themes usually start with a parent or they don't, and they usually don't change parents, so this is pretty low of a priority to ever hit, I think. We could possibly make themes.php a bit smarter about ensuring template is updated if it detects that style.css has changed. (It'd also need to deal with stylesheet_root and template_root, for multiple theme roots.)

comment:2 knutsp4 months ago

I may misunderstand this ticket, but:

You can't change a child theme's parent with a great risk of either having fatal errors in functions.php, and the risk that the stylesheet selectors doesn't apply any more. Only very carefully crafted child themes may change parent. Those only contain standard WordPress actions and filters. Such actions should be put in a (network wide) plugin.

WordPress should not encourage such possibly fatal actions, especially not network wide.

comment:3 jeremyfelt3 months ago

  • Component changed from Multisite to Themes
  • Focuses multisite added

comment:4 SergeyBiryukov4 weeks ago

  • Version changed from trunk to 3.8
Note: See TracTickets for help on using tickets.