WordPress.org

Make WordPress Core

Changeset 25695


Ignore:
Timestamp:
10/06/2013 10:55:42 AM (6 years ago)
Author:
nacin
Message:

Reverse the order of roles in wp_dropdown_roles(). Reset to 'subscriber' when the default role is removed and when a save is invalid.

props garyc40, wonderboymusic.
fixes #14578.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r25642 r25695  
    757757    $r = '';
    758758
    759     $editable_roles = get_editable_roles();
     759    $editable_roles = array_reverse( get_editable_roles() );
    760760
    761761    foreach ( $editable_roles as $role => $details ) {
  • trunk/src/wp-includes/capabilities.php

    r25673 r25695  
    194194        if ( $this->use_db )
    195195            update_option( $this->role_key, $this->roles );
     196
     197        if ( get_option( 'default_role' ) == $role )
     198            update_option( 'default_role', 'subscriber' );
    196199    }
    197200
  • trunk/src/wp-includes/formatting.php

    r25646 r25695  
    29582958            $value = str_replace( 'http://', '', $value );
    29592959            break;
     2960
     2961        case 'default_role' :
     2962            if ( ! get_role( $value ) && get_role( 'subscriber' ) )
     2963                $value = 'subscriber';
     2964            break;
    29602965    }
    29612966
Note: See TracChangeset for help on using the changeset viewer.