Introduce WP_Plugins_List_table:single_row(). See #15318
git-svn-id: https://develop.svn.wordpress.org/trunk@16347 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
07b54f3eb4
commit
a06d0688e9
@ -302,16 +302,24 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
global $status;
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( is_multisite() && !$screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) )
|
||||
return;
|
||||
|
||||
foreach ( $this->items as $plugin_file => $plugin_data )
|
||||
$this->single_row( $plugin_file, $plugin_data );
|
||||
}
|
||||
|
||||
function single_row( $plugin_file, $plugin_data ) {
|
||||
global $status, $page, $s;
|
||||
|
||||
$context = $status;
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( is_multisite() && !$screen->is_network && in_array( $context, array( 'mustuse', 'dropins' ) ) )
|
||||
return;
|
||||
|
||||
foreach ( $this->items as $plugin_file => $plugin_data ) {
|
||||
// preorder
|
||||
$actions = array(
|
||||
'network_deactivate' => '', 'deactivate' => '',
|
||||
@ -348,7 +356,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
$is_active = is_plugin_active( $plugin_file );
|
||||
|
||||
if ( $is_active_for_network && !is_super_admin() && !$screen->is_network )
|
||||
continue;
|
||||
return;
|
||||
|
||||
if ( $screen->is_network ) {
|
||||
if ( $is_active_for_network ) {
|
||||
@ -365,7 +373,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
$actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
|
||||
} else {
|
||||
if ( is_network_only_plugin( $plugin_file ) && !$screen->is_network )
|
||||
continue;
|
||||
return;
|
||||
|
||||
$actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
|
||||
|
||||
@ -391,6 +399,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
$id = sanitize_title( $plugin_name );
|
||||
|
||||
|
||||
echo "
|
||||
<tr id='$id' class='$class'>
|
||||
<th scope='row' class='check-column'>$checkbox</th>
|
||||
@ -434,6 +443,5 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user