[wp-trac] [WordPress Trac] #51129: Avoid the Enable/Disable auto-updates links to appear for externally hosted themes on the Network Admin > Themes screen

WordPress Trac noreply at wordpress.org
Tue Aug 25 02:47:16 UTC 2020


#51129: Avoid the Enable/Disable auto-updates links to appear for externally hosted
themes on the Network Admin > Themes screen
-----------------------------+------------------------
 Reporter:  audrasjb         |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  5.5.1
Component:  Upgrade/Install  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:  multisite
-----------------------------+------------------------

Old description:

> This is a follow-up to #50280
>
> As noted by @pbiron in [comment:66:ticket:50280 comment number 66]:
> ----
> The above (Note: see [48688]) commit did not include the requisite
> changes to `WP_MS_Themes_List_Table`.  The impact is that in multisite,
> the `Enable/Disable auto-updates` links will still appear for externally
> hosted themes on the `Network Admin > Themes` screen.
>
> I'm looking into what it will take to add the multisite support for this.
> It's complicated by the fact that plugins use an array (returned by
> `get_plugin_data()`) and thus can use `array_merge()` on the info in the
> transient, `array( 'update-supported => true )` and the plugin_data;
> whereas themes use an instance of `WP_Theme`...making the array merge not
> possible.
>
> I think something can be worked out using the magic `__get()` and
> `__set()` methods of `WP_Theme`...but still looking into that.

New description:

 This is a follow-up to #

 As noted by @pbiron in comment number 66:
 ----
 The above (Note: see [48688]) commit did not include the requisite changes
 to `WP_MS_Themes_List_Table`.  The impact is that in multisite, the
 `Enable/Disable auto-updates` links will still appear for externally
 hosted themes on the `Network Admin > Themes` screen.

 I'm looking into what it will take to add the multisite support for this.
 It's complicated by the fact that plugins use an array (returned by
 `get_plugin_data()`) and thus can use `array_merge()` on the info in the
 transient, `array( 'update-supported => true )` and the plugin_data;
 whereas themes use an instance of `WP_Theme`...making the array merge not
 possible.

 I think something can be worked out using the magic `__get()` and
 `__set()` methods of `WP_Theme`...but still looking into that.

--

Comment (by afragen):

 So I have a patch that seems to correctly set the auto-update tabs count
 in `prepare_items()` and correctly adds/removes the `Enable|Disable auto-
 updates` links in `column_autoupdates()`.

 Themes are very much different from plugins as we know.

 I'm missing why we actually need the theme headers for setting the auto-
 updates. Can someone explain this a bit for me? I've been working with
 plugin/theme updates for a while and know I can add the `array( 'update-
 supported => true )` if it's really needed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51129#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list