Make WordPress Core


Ignore:
Timestamp:
09/27/2015 07:10:08 PM (11 years ago)
Author:
wonderboymusic
Message:

Users List Table: show the "Change role to" dropdown on the top and bottom. Currently only shows on top.

See #27743.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r34383 r34636  
    215215         */
    216216        protected function extra_tablenav( $which ) {
    217                 if ( 'top' != $which )
    218                         return;
     217                $id = 'bottom' === $which ? 'new_role2' : 'new_role';
    219218        ?>
    220219        <div class="alignleft actions">
    221220                <?php if ( current_user_can( 'promote_users' ) ) : ?>
    222                 <label class="screen-reader-text" for="new_role"><?php _e( 'Change role to&hellip;' ) ?></label>
    223                 <select name="new_role" id="new_role">
     221                <label class="screen-reader-text" for="<?php echo $id ?>"><?php _e( 'Change role to&hellip;' ) ?></label>
     222                <select name="<?php echo $id ?>" id="<?php echo $id ?>">
    224223                        <option value=""><?php _e( 'Change role to&hellip;' ) ?></option>
    225224                        <?php wp_dropdown_roles(); ?>
     
    251250         */
    252251        public function current_action() {
    253                 if ( isset($_REQUEST['changeit']) && !empty($_REQUEST['new_role']) )
     252                if ( isset( $_REQUEST['changeit'] ) &&
     253                        ( ! empty( $_REQUEST['new_role'] ) || ! empty( $_REQUEST['new_role2'] ) ) ) {
    254254                        return 'promote';
     255                }
    255256
    256257                return parent::current_action();
Note: See TracChangeset for help on using the changeset viewer.