mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Privacy: Un-map privacy capabilities to make them available to be assigned for custom roles:
* `erase_others_personal_data` * `export_others_personal_data` * `manage_privacy_options` Previously mapped to `manage_options` or `manage_network` (on Multisite), these are now added to the Administrator role separately. Additionally, `manage_privacy_options` is added to the Editor role. Props garrett-eclipse, xkon, pbiron, desrosj, johnbillion, flixos90, juliobox, lakenh, Ov3rfly, ianatkins. Fixes #44176. git-svn-id: https://develop.svn.wordpress.org/trunk@47269 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -132,7 +132,7 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
|
||||
* so deleting it should require that too.
|
||||
*/
|
||||
if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
|
||||
$caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );
|
||||
$caps[] = 'manage_privacy_options';
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -203,7 +203,7 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
|
||||
* so editing it should require that too.
|
||||
*/
|
||||
if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
|
||||
$caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) );
|
||||
$caps[] = 'manage_privacy_options';
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -580,11 +580,6 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
|
||||
$caps[] = 'update_core';
|
||||
}
|
||||
break;
|
||||
case 'export_others_personal_data':
|
||||
case 'erase_others_personal_data':
|
||||
case 'manage_privacy_options':
|
||||
$caps[] = is_multisite() ? 'manage_network' : 'manage_options';
|
||||
break;
|
||||
default:
|
||||
// Handle meta capabilities for custom post types.
|
||||
global $post_type_meta_caps;
|
||||
|
||||
Reference in New Issue
Block a user