Make WordPress Core

Changeset 52755


Ignore:
Timestamp:
02/17/2022 03:09:27 PM (2 years ago)
Author:
hellofromTonya
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r52707 r52755  
    504504            '_builtin'              => true, /* internal use only. don't use this when registering your own post type. */
    505505            'has_archive'           => false,
    506             'show_ui'               => wp_is_block_theme(),
     506            'show_ui'               => true,
    507507            'show_in_menu'          => false,
    508508            'show_in_admin_bar'     => false,
     
    521521                'edit_private_posts'     => 'edit_theme_options',
    522522                'edit_published_posts'   => 'edit_theme_options',
     523                'edit_posts'             => 'edit_theme_options',
    523524            ),
    524525            'rest_base'             => 'navigation',
Note: See TracChangeset for help on using the changeset viewer.