From 86f16a1881210be210970fcac926cc991b922dbb Mon Sep 17 00:00:00 2001 From: Dion Hulse 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: https://develop.svn.wordpress.org/trunk@14986 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 5a82f12b37..4c985998df 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]}"; }