WordPress.org

Make WordPress Core

Changeset 27310


Ignore:
Timestamp:
02/27/2014 10:21:13 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Use wp_dropdown_roles() in wp-admin/network/site-users.php.

props jeremyfelt.
fixes #27215.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-users.php

    r26518 r27310  
    5252
    5353switch_to_blog( $id );
    54 
    55 $editblog_roles = $wp_roles->roles;
    56 
    57 $default_role = get_option( 'default_role' );
    5854
    5955$action = $wp_list_table->current_action();
     
    271267            <th scope="row"><?php _e( 'Role' ); ?></th>
    272268            <td><select name="new_role" id="new_role_0">
    273             <?php
    274             reset( $editblog_roles );
    275             foreach ( $editblog_roles as $role => $role_assoc ) {
    276                 $name = translate_user_role( $role_assoc['name'] );
    277                 echo '<option ' . selected( $default_role, $role, false ) . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
    278             }
    279             ?>
     269            <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>
    280270            </select></td>
    281271        </tr>
     
    310300            <th scope="row"><?php _e( 'Role' ); ?></th>
    311301            <td><select name="new_role" id="new_role_0">
    312             <?php
    313             reset( $editblog_roles );
    314             foreach ( $editblog_roles as $role => $role_assoc ) {
    315                 $name = translate_user_role( $role_assoc['name'] );
    316                 echo '<option ' . selected( $default_role, $role, false ) . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
    317             }
    318             ?>
     302            <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>
    319303            </select></td>
    320304        </tr>
Note: See TracChangeset for help on using the changeset viewer.