Add Importer support to Plugin Install workflow, Offers to Activate Plugin & Run installer, and returning to Imports upon successful Importer Plugin Installation. See #13566
git-svn-id: http://svn.automattic.com/wordpress/trunk@14985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1261,14 +1261,21 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
|
||||
|
||||
$plugin_file = $this->upgrader->plugin_info();
|
||||
|
||||
$install_actions = array(
|
||||
'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
|
||||
);
|
||||
$install_actions = array();
|
||||
|
||||
$from = isset($_GET['from']) ? stripslashes($_GET['from']) : 'plugins';
|
||||
|
||||
if ( 'import' == $from )
|
||||
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&from=import&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin & Run Importer') . '</a>';
|
||||
else
|
||||
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>';
|
||||
|
||||
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
|
||||
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
|
||||
|
||||
if ( $this->type == 'web' )
|
||||
if ( 'import' == $from )
|
||||
$install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>';
|
||||
else if ( $this->type == 'web' )
|
||||
$install_actions['plugins_page'] = '<a href="' . admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
|
||||
else
|
||||
$install_actions['plugins_page'] = '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
|
||||
|
||||
@@ -473,6 +473,8 @@ function install_plugin_install_status($api, $loop = false) {
|
||||
$url = wp_nonce_url(admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
|
||||
}
|
||||
}
|
||||
if ( isset($_GET['from']) )
|
||||
$url .= '&from=' . urlencode(stripslashes($_GET['from']));
|
||||
|
||||
return compact('status', 'url', 'version');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user