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/plugins.php

    r14956 r14985  
    5252            $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin, $network_wide);
    5353            if ( is_wp_error( $result ) ) {
    54                 if ('unexpected_output' == $result->get_error_code()) {
     54                if ( 'unexpected_output' == $result->get_error_code() ) {
    5555                    $redirect = 'plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin;
    5656                    wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
     
    6666                update_option('recently_activated', $recent);
    6767            }
    68 
    69             wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above
     68            if ( isset($_GET['from']) && 'import' == $_GET['from'] ) {
     69                wp_redirect("import.php?import=" . str_replace('-importer', '', dirname($plugin)) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix
     70            } else {
     71                wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above
     72            }
    7073            exit;
    7174            break;
     
    438441$total_dropins_plugins = count($dropins_plugins);
    439442
    440 //Searching.
     443// Searching.
    441444if ( !empty($_GET['s']) ) {
    442445    function _search_plugins_filter_callback($plugin) {
Note: See TracChangeset for help on using the changeset viewer.