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.


git-svn-id: https://develop.svn.wordpress.org/trunk@25695 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-10-06 10:55:42 +00:00
parent c0fb231f92
commit 352ff49768
3 changed files with 9 additions and 1 deletions

View File

@@ -2957,6 +2957,11 @@ function sanitize_option($option, $value) {
$value = esc_url_raw( $value );
$value = str_replace( 'http://', '', $value );
break;
case 'default_role' :
if ( ! get_role( $value ) && get_role( 'subscriber' ) )
$value = 'subscriber';
break;
}
$value = apply_filters("sanitize_option_{$option}", $value, $option);