WordPress.org

Make WordPress Core

Changeset 11004


Ignore:
Timestamp:
04/19/2009 06:53:05 PM (9 years ago)
Author:
ryan
Message:

Show actions based on plugin active status. see #9527

File:
1 edited

Legend:

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

    r11003 r11004  
    341341    foreach ( (array)$plugins as $plugin_file => $plugin_data) {
    342342        $actions = array();
    343 
    344         if ( 'active' == $context )
     343        $is_active = is_plugin_active($plugin_file);
     344
     345        if ( $is_active )
    345346            $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
    346347        else //Inactive or Recently deactivated
     
    353354        $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
    354355        $action_count = count($actions);
    355         $class = is_plugin_active($plugin_file) ? 'active' : 'inactive';
     356        $class = $is_active ? 'active' : 'inactive';
    356357        echo "
    357358    <tr class='$class'>
Note: See TracChangeset for help on using the changeset viewer.