Make WordPress Core


Ignore:
Timestamp:
09/27/2012 12:47:01 AM (12 years ago)
Author:
nacin
Message:

Browse and install your wordpress.org plugin favorites from the plugin installer. props Otto42, Japh, DrewAPicture. fixes #22002.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-plugin-install-list-table.php

    r22019 r22026  
    3030        if ( 'search' == $tab )
    3131            $tabs['search'] = __( 'Search Results' );
    32         $tabs['upload'] = __( 'Upload' );
    33         $tabs['featured'] = _x( 'Featured','Plugin Installer' );
    34         $tabs['popular']  = _x( 'Popular','Plugin Installer' );
    35         $tabs['new']      = _x( 'Newest','Plugin Installer' );
     32        $tabs['upload']    = __( 'Upload' );
     33        $tabs['featured']  = _x( 'Featured', 'Plugin Installer' );
     34        $tabs['popular']   = _x( 'Popular', 'Plugin Installer' );
     35        $tabs['new']       = _x( 'Newest', 'Plugin Installer' );
     36        $tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' );
    3637
    3738        $nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
     
    7071            case 'new':
    7172                $args['browse'] = $tab;
     73                break;
     74
     75            case 'favorites':
     76                $user = isset( $_GET['user'] ) ? stripslashes( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
     77                update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
     78                if ( $user )
     79                    $args['user'] = $user;
     80                else
     81                    $args = false;
     82
     83                add_action( 'install_plugins_favorites', 'install_plugins_favorites_form', 9, 0 );
    7284                break;
    7385
Note: See TracChangeset for help on using the changeset viewer.