[wp-trac] [WordPress Trac] #31530: Shiny Updates: Installing themes
WordPress Trac
noreply at wordpress.org
Thu Mar 5 18:52:32 UTC 2015
#31530: Shiny Updates: Installing themes
-----------------------------+---------------------------------------------
Reporter: pento | Owner:
Type: task (blessed) | Status: new
Priority: normal | Milestone: 4.2
Component: Upgrade/Install | Version:
Severity: normal | Resolution:
Keywords: shiny-updates | Focuses: ui, javascript, administration
-----------------------------+---------------------------------------------
Comment (by stephdau):
I've started looking into this and #31529. I started with the AJAX
actions.
`wp_ajax_install_plugin()` ([source:/trunk/src/wp-admin/includes/ajax-
actions.php#L2884 src]) can easily either be ported to a theme-specific
version, or be refactored into one function to handle both plugins and
themes. I'd venture a theme-specific instance is a better way to go, in
case either diverges, and since it's what's done in a lot of
plugins/themes related code in WP.
The only process in `wp_ajax_install_plugin()` that currently can't be
ported by simply changing 'plugin' for 'theme' in that function is
`install_plugin_install_status()`, which we'll need an equivalent of. The
closest in themes, currently, is `get_theme_update_available()` (also uses
`get_site_transient('update_themes')`, as
`install_plugin_install_status()` uses
`get_site_transient('update_plugins')`).
Other small difference: the `themes_api()` definition is in
[source:/trunk/src/wp-admin/includes/theme.php theme.php], not
[source:/trunk/src/wp-admin/includes/theme-install.php theme-install.php]
and unlike `plugins_api()`, which lives in [source:/trunk/src/wp-
admin/includes/plugin-install.php plugin-install.php].
I haven't looked into the details of the `wp_ajax_update_plugin` (aka
#31529), but since it also uses code that has a theme equivalent (updates
transient, `Plugin_Upgrader` vs `Theme_Upgrader`), the same is quite
likely.
Any thoughts on:
* theme vs plublic specific AJAX action vs one hat handles install for
both plugin/theme, same for updates?
* creating a `install_theme_install_status()` function in theme-
install.php based on `install_plugin_install_status()`?
Once we have functional AJAX actions for the themes, the rest is mainly
UX, right? Swapping install buttons for updates, having both use the AJAX
actions instead of going to up the updates page, etc.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31530#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list