Ticket #14578: 14578.diff
| File 14578.diff, 2.9 KB (added by wonderboymusic, 4 months ago) |
|---|
-
wp-includes/default-filters.php
177 177 add_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop 178 178 add_filter( 'option_home', '_config_wp_home' ); 179 179 add_filter( 'option_siteurl', '_config_wp_siteurl' ); 180 add_filter( 'option_default_role', '_wp_filter_verify_default_role' ); 180 181 add_filter( 'tiny_mce_before_init', '_mce_set_direction' ); 181 182 add_filter( 'pre_kses', 'wp_pre_kses_less_than' ); 182 183 add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 ); -
wp-includes/capabilities.php
167 167 $this->roles[$role] = array( 168 168 'name' => $display_name, 169 169 'capabilities' => $capabilities 170 );170 ); 171 171 if ( $this->use_db ) 172 172 update_option( $this->role_key, $this->roles ); 173 173 $this->role_objects[$role] = new WP_Role( $role, $capabilities ); … … 193 193 194 194 if ( $this->use_db ) 195 195 update_option( $this->role_key, $this->roles ); 196 197 if ( get_option( 'default_role' ) == $role ) 198 update_option( 'default_role', 'subscriber' ); 196 199 } 197 200 198 201 /** … … 1466 1469 1467 1470 return false; 1468 1471 } 1472 1473 /** 1474 * Filter "default_role" option 1475 * 1476 * @since 3.6.0 1477 * 1478 * @param string $role Role name. 1479 * @return string Filtered default role. 1480 */ 1481 function _wp_filter_verify_default_role( $role ) { 1482 $role_obj = get_role( $role ); 1483 if ( empty( $role_obj ) ) 1484 $role = 'subscriber'; 1485 1486 return $role; 1487 } 1488 No newline at end of file -
wp-admin/includes/template.php
756 756 * @param string $selected slug for the role that should be already selected 757 757 */ 758 758 function wp_dropdown_roles( $selected = false ) { 759 $p = '';760 759 $r = ''; 761 760 762 $editable_roles = get_editable_roles();761 $editable_roles = array_reverse( get_editable_roles() ); 763 762 764 763 foreach ( $editable_roles as $role => $details ) { 765 764 $name = translate_user_role($details['name'] ); 766 765 if ( $selected == $role ) // preselect specified role 767 $ p= "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>";766 $r .= "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>"; 768 767 else 769 768 $r .= "\n\t<option value='" . esc_attr($role) . "'>$name</option>"; 770 769 } 771 echo $ p . $r;770 echo $r; 772 771 } 773 772 774 773 /**
