Make WordPress Core


Ignore:
Timestamp:
08/12/2010 11:21:05 PM (14 years ago)
Author:
scribu
Message:

Introduce WP_List_Table::check_permissions() and WP_List_Table::prepare_items(). Fixes #14596; See #14579

File:
1 edited

Legend:

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

    r15492 r15496  
    99/** WordPress Administration Bootstrap */
    1010require_once('./admin.php');
    11 if ( is_multisite() ) {
    12     $menu_perms = get_site_option( 'menu_items', array() );
    13        
    14     if ( empty( $menu_perms['plugins'] ) ) {
    15         if ( ! is_super_admin() )
    16             wp_die( __( 'Cheatin’ uh?' ) );
    17     }
    18 }
    19 
    20 if ( ! current_user_can( 'activate_plugins' ) )
    21     wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
     11
     12require_once( ABSPATH . 'wp-admin/includes/default-list-tables.php' );
     13
     14$table = new WP_Plugins_Table;
     15$table->check_permissions();
    2216
    2317if ( isset($_POST['clear-recent-list']) )
     
    300294}
    301295
    302 require_once( ABSPATH . 'wp-admin/includes/default-list-tables.php' );
    303 
    304 $table = new WP_Plugins_Table;
     296$default_status = get_user_option( 'plugins_last_view' );
     297if ( empty( $default_status ) )
     298    $default_status = 'all';
     299$status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status;
     300if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )
     301    $status = 'all';
     302if ( $status != $default_status && 'search' != $status )
     303    update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
     304
     305$table->prepare_items();
    305306
    306307wp_enqueue_script('plugin-install');
Note: See TracChangeset for help on using the changeset viewer.