mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 00:01:27 +01:00
Show actions based on plugin active status. see #9527
git-svn-id: http://svn.automattic.com/wordpress/trunk@11004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dd5ea16c6f
commit
c72dd79062
@ -340,8 +340,9 @@ function print_plugins_table($plugins, $context = '') {
|
|||||||
}
|
}
|
||||||
foreach ( (array)$plugins as $plugin_file => $plugin_data) {
|
foreach ( (array)$plugins as $plugin_file => $plugin_data) {
|
||||||
$actions = array();
|
$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&plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
|
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
|
||||||
else //Inactive or Recently deactivated
|
else //Inactive or Recently deactivated
|
||||||
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
|
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&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', $actions, $plugin_file, $plugin_data, $context );
|
||||||
$actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
|
$actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
|
||||||
$action_count = count($actions);
|
$action_count = count($actions);
|
||||||
$class = is_plugin_active($plugin_file) ? 'active' : 'inactive';
|
$class = $is_active ? 'active' : 'inactive';
|
||||||
echo "
|
echo "
|
||||||
<tr class='$class'>
|
<tr class='$class'>
|
||||||
<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . attribute_escape($plugin_file) . "' /></th>
|
<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . attribute_escape($plugin_file) . "' /></th>
|
||||||
|
Loading…
Reference in New Issue
Block a user