Show actions based on plugin active status. see #9527

git-svn-id: https://develop.svn.wordpress.org/trunk@11004 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-04-19 18:53:05 +00:00
parent 4cd99b0f04
commit cff07d7f0d
1 changed files with 3 additions and 2 deletions

View File

@ -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[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
else //Inactive or Recently deactivated
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
@ -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 "
<tr class='$class'>
<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . attribute_escape($plugin_file) . "' /></th>