diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php
index a2e8216457..b0d2a4ec6e 100644
a
|
b
|
function populate_roles() { |
695 | 695 | populate_roles_270(); |
696 | 696 | populate_roles_280(); |
697 | 697 | populate_roles_300(); |
| 698 | populate_roles_540(); |
698 | 699 | } |
699 | 700 | |
700 | 701 | /** |
… |
… |
function populate_roles_300() { |
924 | 925 | } |
925 | 926 | } |
926 | 927 | |
| 928 | /** |
| 929 | * Create and modify WordPress roles for WordPress 5.4. |
| 930 | * |
| 931 | * @since 5.4.0 |
| 932 | */ |
| 933 | function populate_roles_540() { |
| 934 | // Add the privacy caps to the Administrators. |
| 935 | $role = get_role( 'administrator' ); |
| 936 | |
| 937 | if ( ! empty( $role ) ) { |
| 938 | $role->add_cap( 'export_others_personal_data' ); |
| 939 | $role->add_cap( 'erase_others_personal_data' ); |
| 940 | $role->add_cap( 'manage_privacy_options' ); |
| 941 | } |
| 942 | } |
| 943 | |
927 | 944 | if ( ! function_exists( 'install_network' ) ) : |
928 | 945 | /** |
929 | 946 | * Install Network. |
diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php
index 7aec19663d..b78d4f5bde 100644
a
|
b
|
if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) |
288 | 288 | $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' ); |
289 | 289 | } |
290 | 290 | |
291 | | $menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); |
| 291 | if ( current_user_can( 'manage_options' ) ) { |
| 292 | $menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); |
| 293 | } elseif ( current_user_can( 'manage_privacy_options' ) && ! current_user_can( 'manage_options' ) ) { |
| 294 | $menu[80] = array( __( 'Settings' ), 'manage_privacy_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); |
| 295 | } |
| 296 | |
292 | 297 | $submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' ); |
293 | 298 | $submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' ); |
294 | 299 | $submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' ); |
diff --git a/src/wp-includes/capabilities.php b/src/wp-includes/capabilities.php
index 0c40c7e384..afd089618f 100644
a
|
b
|
function map_meta_cap( $cap, $user_id, ...$args ) { |
573 | 573 | $caps[] = 'update_core'; |
574 | 574 | } |
575 | 575 | break; |
576 | | case 'export_others_personal_data': |
577 | | case 'erase_others_personal_data': |
578 | | case 'manage_privacy_options': |
579 | | $caps[] = is_multisite() ? 'manage_network' : 'manage_options'; |
580 | | break; |
581 | 576 | default: |
582 | 577 | // Handle meta capabilities for custom post types. |
583 | 578 | global $post_type_meta_caps; |