From 5bdf4b729aa438761b8b697e10979c2dbca2ecb1 Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Thu, 16 Dec 2021 12:42:47 +0000 Subject: [PATCH 1/2] Copy capabililties from menu items to wp_navigation --- src/wp-includes/post.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index d9c2774adf790..71de3194ec619 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -509,6 +509,24 @@ function create_initial_post_types() { 'show_in_rest' => true, 'rewrite' => false, 'map_meta_cap' => true, + 'capabilities' => array( + // Meta Capabilities. + 'edit_post' => 'edit_post', + 'read_post' => 'read_post', + 'delete_post' => 'delete_post', + // Primitive Capabilities. + 'edit_posts' => 'edit_theme_options', + 'edit_others_posts' => 'edit_theme_options', + 'delete_posts' => 'edit_theme_options', + 'publish_posts' => 'edit_theme_options', + 'read_private_posts' => 'edit_theme_options', + 'read' => 'read', + 'delete_private_posts' => 'edit_theme_options', + 'delete_published_posts' => 'edit_theme_options', + 'delete_others_posts' => 'edit_theme_options', + 'edit_private_posts' => 'edit_theme_options', + 'edit_published_posts' => 'edit_theme_options', + ), 'rest_base' => 'navigation', 'rest_controller_class' => 'WP_REST_Posts_Controller', 'supports' => array( From a06ca14ec7c3df1dc50e574acb5ec4f4d57253b1 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Mon, 20 Dec 2021 08:01:59 -0600 Subject: [PATCH 2/2] Matches capabilities added in Gutenberg. --- src/wp-includes/post.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 71de3194ec619..5cc7f66244251 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -510,17 +510,11 @@ function create_initial_post_types() { 'rewrite' => false, 'map_meta_cap' => true, 'capabilities' => array( - // Meta Capabilities. - 'edit_post' => 'edit_post', - 'read_post' => 'read_post', - 'delete_post' => 'delete_post', - // Primitive Capabilities. - 'edit_posts' => 'edit_theme_options', 'edit_others_posts' => 'edit_theme_options', 'delete_posts' => 'edit_theme_options', 'publish_posts' => 'edit_theme_options', + 'create_posts' => 'edit_theme_options', 'read_private_posts' => 'edit_theme_options', - 'read' => 'read', 'delete_private_posts' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options',