Make WordPress Core


Ignore:
Timestamp:
05/27/2010 11:04:08 AM (14 years ago)
Author:
dd32
Message:

Add Importer support to Plugin Install workflow, Offers to Activate Plugin & Run installer, and returning to Imports upon successful Importer Plugin Installation. See #13566

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r14924 r14985  
    12621262        $plugin_file = $this->upgrader->plugin_info();
    12631263
    1264         $install_actions = array(
    1265             'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
    1266                             );
     1264        $install_actions = array();
     1265
     1266        $from = isset($_GET['from']) ? stripslashes($_GET['from']) : 'plugins';
     1267
     1268        if ( 'import' == $from )
     1269            $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;from=import&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin &amp; Run Importer') . '</a>';
     1270        else
     1271            $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>';
    12671272
    12681273        if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
    12691274            $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
    12701275
    1271         if ( $this->type == 'web' )
     1276        if ( 'import' == $from )
     1277            $install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>';
     1278        else if ( $this->type == 'web' )
    12721279            $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>';
    12731280        else
Note: See TracChangeset for help on using the changeset viewer.