mirror of
git://develop.git.wordpress.org/
synced 2025-03-23 21:39:50 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52755 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fcd5d3b495
commit
51531f054e
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user