From f7eed7e8326b466e22a8e086fabd24f0288699cc Mon Sep 17 00:00:00 2001 From: dd32 Date: Thu, 27 May 2010 11:23:07 +0000 Subject: [PATCH] Change Install link to Activate link in Importer if plugin appears to be already installed. See #13566 git-svn-id: http://svn.automattic.com/wordpress/trunk@14986 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/import.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/wp-admin/import.php b/wp-admin/import.php index 5a82f12b3..4c985998d 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -94,11 +94,23 @@ if (empty ($importers)) { $style = ''; foreach ($importers as $id => $data) { $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; + $action = ''; if ( 'install' == $data[2] ) { $plugin_slug = $id . '-importer'; - $action = '' . $data[0] . ''; + if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) { + // Looks like Importer is installed, But not active + $plugins = get_plugins( '/' . $plugin_slug ); + if ( !empty($plugins) ) { + $keys = array_keys($plugins); + $plugin_file = $plugin_slug . '/' . $keys[0]; + $action = '' . $data[0] . ''; + } + } + if ( empty($action) ) + $action = '' . $data[0] . ''; } else { $action = "{$data[0]}"; }