From 37a638ae8a1f455e6225d67fdc7e89c8c08d2e0a Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 24 Mar 2017 14:53:46 +0000 Subject: [PATCH] Users: Don't push the current user's role to the top of the list in `wp_dropdown_roles()`. This brings consistency to the order in which roles are displayed in the `Roles` dropdown when editing users. Props bor0 Fixes #40162 Built from https://develop.svn.wordpress.org/trunk@40323 git-svn-id: http://core.svn.wordpress.org/trunk@40230 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 14 ++++++++------ wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 3c79d43b37..a4672fdbe0 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -821,19 +821,21 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) * @param string $selected Slug for the role that should be already selected. */ function wp_dropdown_roles( $selected = '' ) { - $p = ''; $r = ''; $editable_roles = array_reverse( get_editable_roles() ); foreach ( $editable_roles as $role => $details ) { $name = translate_user_role($details['name'] ); - if ( $selected == $role ) // preselect specified role - $p = "\n\t"; - else - $r .= "\n\t"; + // preselect specified role + if ( $selected == $role ) { + $r .= "\n\t"; + } else { + $r .= "\n\t"; + } } - echo $p . $r; + + echo $r; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index f7e93aa587..40ac767a52 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40322'; +$wp_version = '4.8-alpha-40323'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.