From c72dd79062e29bec0fded133680d89f5657a9487 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 19 Apr 2009 18:53:05 +0000 Subject: [PATCH] Show actions based on plugin active status. see #9527 git-svn-id: http://svn.automattic.com/wordpress/trunk@11004 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/plugins.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 9f70eb7403..774b86c07a 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -340,8 +340,9 @@ function print_plugins_table($plugins, $context = '') { } foreach ( (array)$plugins as $plugin_file => $plugin_data) { $actions = array(); + $is_active = is_plugin_active($plugin_file); - if ( 'active' == $context ) + if ( $is_active ) $actions[] = '' . __('Deactivate') . ''; else //Inactive or Recently deactivated $actions[] = '' . __('Activate') . ''; @@ -352,7 +353,7 @@ function print_plugins_table($plugins, $context = '') { $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context ); $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context ); $action_count = count($actions); - $class = is_plugin_active($plugin_file) ? 'active' : 'inactive'; + $class = $is_active ? 'active' : 'inactive'; echo "