Skip to content

Commit

Permalink
Editor: Add 'edit_theme_options' capabilities to wp_navigation post…
Browse files Browse the repository at this point in the history
… type.

Adds `'edit_theme_options'` capabilities top restrict Navigation permission.

Partial backport from Gutenberg WordPress/gutenberg#37454.

Follow-up to [52069], [52145].

Props spacedmonkey, get_dave, hellofromTonya.
See #54487.

git-svn-id: https://develop.svn.wordpress.org/trunk@52400 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
hellofromtonya committed Dec 21, 2021
1 parent e1f5600 commit 0435e03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,18 @@ function create_initial_post_types() {
'show_in_rest' => true,
'rewrite' => false,
'map_meta_cap' => true,
'capabilities' => array(
'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',
'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(
Expand Down

0 comments on commit 0435e03

Please sign in to comment.