Make WordPress Core

Changeset 18535


Ignore:
Timestamp:
08/11/2011 08:49:47 PM (14 years ago)
Author:
duck_
Message:

Direct a user to the main site to install importers, fixes #17990

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import.php

    r17748 r18535  
    114114                }
    115115            }
    116             if ( empty($action) )
    117                 $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
     116            if ( empty($action) ) {
     117                if ( is_main_site() ) {
     118                    $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
    118119                                        '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
    119120                                        esc_attr__('Install importer') . '">' . $data[0] . '</a>';
     121                } else {
     122                    $action = $data[0];
     123                    $data[1] = sprintf( __( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ), get_admin_url( $current_site->blog_id, 'import.php' ) );
     124                }
     125            }
    120126        } else {
    121127            $action = "<a href='" . esc_url("admin.php?import=$id") . "' title='" . esc_attr( wptexturize(strip_tags($data[1])) ) ."'>{$data[0]}</a>";
Note: See TracChangeset for help on using the changeset viewer.