restrict_manage_users action. props jakemgold, johnjamesjacoby. fixes #19295.

git-svn-id: http://core.svn.wordpress.org/trunk@22414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-07 07:59:46 +00:00
parent 10b381a047
commit dd50d7d0e0
1 changed files with 8 additions and 6 deletions

View File

@ -136,18 +136,20 @@ class WP_Users_List_Table extends WP_List_Table {
function extra_tablenav( $which ) { function extra_tablenav( $which ) {
if ( 'top' != $which ) if ( 'top' != $which )
return; return;
if ( ! current_user_can( 'promote_users' ) ) ?>
return;
?>
<div class="alignleft actions"> <div class="alignleft actions">
<?php if ( current_user_can( 'promote_users' ) ) : ?>
<label class="screen-reader-text" for="new_role"><?php _e( 'Change role to&hellip;' ) ?></label> <label class="screen-reader-text" for="new_role"><?php _e( 'Change role to&hellip;' ) ?></label>
<select name="new_role" id="new_role"> <select name="new_role" id="new_role">
<option value=''><?php _e( 'Change role to&hellip;' ) ?></option> <option value=''><?php _e( 'Change role to&hellip;' ) ?></option>
<?php wp_dropdown_roles(); ?> <?php wp_dropdown_roles(); ?>
</select> </select>
<?php submit_button( __( 'Change' ), 'small', 'changeit', false ); ?> <?php
</div> submit_button( __( 'Change' ), 'small', 'changeit', false );
<?php endif;
do_action( 'restrict_manage_users' );
echo '</div>';
} }
function current_action() { function current_action() {