*/
class WP_Plugins_List_Table extends WP_List_Table {
- function WP_Plugins_List_Table() {
+ function __construct() {
global $status, $page;
- $default_status = get_user_option( 'plugins_last_view' );
- if ( empty( $default_status ) )
- $default_status = 'all';
- $status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status;
- if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )
- $status = 'all';
- if ( $status != $default_status && 'search' != $status )
- update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
+ $status = 'all';
+ if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )
+ $status = $_REQUEST['plugin_status'];
+
+ if ( isset($_REQUEST['s']) )
+ $_SERVER['REQUEST_URI'] = add_query_arg('s', stripslashes($_REQUEST['s']) );
$page = $this->get_pagenum();
- parent::WP_List_Table( array(
+ parent::__construct( array(
'plural' => 'plugins',
) );
}
-
+
function get_table_classes() {
return array( 'widefat', $this->_args['plural'] );
}
uasort( $this->items, array( &$this, '_order_callback' ) );
}
- $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ) );
+ $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 );
$start = ( $page - 1 ) * $plugins_per_page;
if ( 'recently_activated' == $status )
submit_button( __( 'Clear List' ), 'secondary', 'clear-recent-list', false );
elseif ( 'top' == $which && 'mustuse' == $status )
- echo '<p>' . __( 'Files in the <code>/wp-content/mu-plugins</code> directory are executed automatically.' ) . '</p>';
+ echo '<p>' . sprintf( __( 'Files in the <code>%s</code> directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '</p>';
elseif ( 'top' == $which && 'dropins' == $status )
- echo '<p>' . __( 'Drop-ins are advanced plugins in the <code>/wp-content</code> directory that replace WordPress functionality when present.' ) . '</p>';
+ echo '<p>' . sprintf( __( 'Drop-ins are advanced plugins in the <code>%s</code> directory that replace WordPress functionality when present.' ), str_replace( ABSPATH, '', WP_CONTENT_DIR ) ) . '</p>';
echo '</div>';
}