From 9ac43b6ade9f98367fd0cca805c9c0350a40b1df Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Thu, 17 Feb 2022 15:11:01 +0000 Subject: [PATCH] Editor: Grant only admins access to the "Navigation Menus" UI for block and non-block themes. Restricts and grants access to only admin roles for the Navigation Menu UI screen, i.e. either directly through the URL wp-admin/edit.php?post_type=wp_navigation or via the Navigation block's "Manage menu" option (in the block's toolbar). It resolves 2 issues: - For non-block themes, fixes the issue where admins could not access the UI. - For block themes, restricts access to only admin roles, i.e. non-admins no longer have access to the UI. Non-admins will receive the "Sorry, you are not allowed to edit posts in this post type" error message. Follow-up [52069], [52145], [52330], [52400]. Props ironprogrammer, costdev, noisysocks, talldanwp, hellofromTonya, manfcarlo, pyrobd. Fixes #54889. Built from https://develop.svn.wordpress.org/trunk@52755 git-svn-id: http://core.svn.wordpress.org/trunk@52344 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 93eaed4294..7ceff7b693 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -503,7 +503,7 @@ function create_initial_post_types() { 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'has_archive' => false, - 'show_ui' => wp_is_block_theme(), + 'show_ui' => true, 'show_in_menu' => false, 'show_in_admin_bar' => false, 'show_in_rest' => true, @@ -520,6 +520,7 @@ function create_initial_post_types() { 'delete_others_posts' => 'edit_theme_options', 'edit_private_posts' => 'edit_theme_options', 'edit_published_posts' => 'edit_theme_options', + 'edit_posts' => 'edit_theme_options', ), 'rest_base' => 'navigation', 'rest_controller_class' => 'WP_REST_Posts_Controller', diff --git a/wp-includes/version.php b/wp-includes/version.php index 561a4ef636..b0b7dbcbc6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52754'; +$wp_version = '6.0-alpha-52755'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.