Opened 7 years ago
Last modified 7 years ago
#42806 new enhancement
Allow installing themes in the Customizer on multisite
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | 2nd-opinion needs-patch |
Focuses: | multisite | Cc: |
Description
Currently the "Install Themes" section in the Customizer isn't added when using multisite.
There is no technical problem with the installation process, as it still works correctly, simply by adding removing the restriction to only add the section (and enqueueing the related script) if is_multisite()
, which I tested before opening this ticket.
However, what would need to be figured out is how to deal with enabling themes, because by default an installed themes isn't enabled anywhere. And of course it would only be possible for the network administrator, but I think that would still bring a huge benefit, because right now it isn't possible in multisite at all.
Here are two suggestions for possible approaches:
- When in a multisite, there could be a notification like "By installing a theme you also automatically enable it for this site." Then, after the installation logic we would only need to handle that part automatically. If we go with that approach, we would need to make sure that the current user has both the
install_themes
andmanage_network_themes
capabilities. - When in a multisite, there could be a separate section "Network Installed Themes" that includes all themes installed, regardless of whether they're enabled for the site. Each themes would have a button to enable/disable it for the site. That section would require the user to have the
manage_network_themes
capability. We would furthermore need to ensure that themes are transitioned from the "Network Installed Themes" to the existing "Installed Themes" section and vice-versa when they are enabled/disabled for the site. Plus, when installing a theme through the "WordPress.org Themes" section, the user would need to be redirected to the "Network Installed Themes" section with that theme pre-seleted, to easily be able to enable and preview it.
There are benefits to both ways: While the first approach will be much simpler to implement, it somewhat mixes installing and enabling themes into one. The latter approach will allow more flexibility, but may be overly complex. Especially since installing themes without being able to enable them will make the process useless in multisite, I think I prefer the first approach. Maybe a mix of both could be the right way too, where we start with implementing the first approach as a first iteration (that could even be merged into core as that), but keeping it future-compatible to possibly add a dedicated "Network Installed Themes" section later.
We need to work on a general strategy for multisite network management within the customizer, evaluating the appropriate use of live preview for various network administration tasks. I would support basic theme-install support for super-admins in the meantime. Option 1 above seems like a reasonable approach for now.