WordPress.org

Make WordPress Core

Ticket #32056: 32056.diff

File 32056.diff, 695 bytes (added by valendesigns, 7 years ago)
  • src/wp-admin/includes/template.php

    diff --git src/wp-admin/includes/template.php src/wp-admin/includes/template.php
    index 03ff4e7..bcb1ec5 100644
    function wp_dropdown_roles( $selected = '' ) { 
    882882
    883883        foreach ( $editable_roles as $role => $details ) {
    884884                $name = translate_user_role($details['name'] );
    885                 if ( $selected == $role ) // preselect specified role
     885                // preselect specified role
     886                if ( $selected === $role ) {
    886887                        $p = "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>";
    887                 else
     888                } else {
    888889                        $r .= "\n\t<option value='" . esc_attr($role) . "'>$name</option>";
     890                }
    889891        }
    890892        echo $p . $r;
    891893}