WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #31530, comment 1


Ignore:
Timestamp:
03/05/2015 06:53:45 PM (7 years ago)
Author:
stephdau
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31530, comment 1

    v1 v2  
    33`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.
    44
    5 The only process in `wp_ajax_install_plugin()` that currently can't be ported by simply changing 'plugin' for 'theme' in that function is the cal to `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')`).
     5The only process in `wp_ajax_install_plugin()` that currently can't be ported by simply changing 'plugin' for 'theme' in that function is the call to `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')`).
    66
    77Other 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].