diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index d426533..538fe3a 100644
|
|
|
function the_attachment_links( $id = false ) {
|
| 754 | 754 | * @param string $selected slug for the role that should be already selected |
| 755 | 755 | */ |
| 756 | 756 | function wp_dropdown_roles( $selected = false ) { |
| 757 | | $p = ''; |
| 758 | 757 | $r = ''; |
| 759 | 758 | |
| 760 | | $editable_roles = get_editable_roles(); |
| | 759 | $editable_roles = array_reverse( get_editable_roles() ); |
| 761 | 760 | |
| 762 | 761 | foreach ( $editable_roles as $role => $details ) { |
| 763 | 762 | $name = translate_user_role($details['name'] ); |
| 764 | 763 | if ( $selected == $role ) // preselect specified role |
| 765 | | $p = "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>"; |
| | 764 | $r .= "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>"; |
| 766 | 765 | else |
| 767 | 766 | $r .= "\n\t<option value='" . esc_attr($role) . "'>$name</option>"; |
| 768 | 767 | } |
| 769 | | echo $p . $r; |
| | 768 | echo $r; |
| 770 | 769 | } |
| 771 | 770 | |
| 772 | 771 | /** |
diff --git wp-includes/capabilities.php wp-includes/capabilities.php
index c3bb58f..3ab4a49 100644
|
|
|
class WP_Roles {
|
| 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 ); |
| … |
… |
class WP_Roles {
|
| 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 | /** |
| … |
… |
function is_super_admin( $user_id = false ) {
|
| 1466 | 1469 | |
| 1467 | 1470 | return false; |
| 1468 | 1471 | } |
| | 1472 | |
| | 1473 | /** |
| | 1474 | * Filter "default_role" option |
| | 1475 | * |
| | 1476 | * @since 3.7.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 |
diff --git wp-includes/default-filters.php wp-includes/default-filters.php
index de97238..c71272d 100644
|
|
|
add_filter( 'option_blog_charset', '_wp_specialchars' );
|
| 178 | 178 | add_filter( 'option_blog_charset', '_canonical_charset' ); |
| 179 | 179 | add_filter( 'option_home', '_config_wp_home' ); |
| 180 | 180 | add_filter( 'option_siteurl', '_config_wp_siteurl' ); |
| | 181 | add_filter( 'option_default_role', '_wp_filter_verify_default_role' ); |
| 181 | 182 | add_filter( 'tiny_mce_before_init', '_mce_set_direction' ); |
| 182 | 183 | add_filter( 'pre_kses', 'wp_pre_kses_less_than' ); |
| 183 | 184 | add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 ); |