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.
Built from https://develop.svn.wordpress.org/trunk@52400


git-svn-id: http://core.svn.wordpress.org/trunk@51992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
hellofromtonya committed Dec 21, 2021
1 parent 84229df commit 770e631
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-beta3-52399';
$wp_version = '5.9-beta3-52400';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 770e631

Please sign in to comment.