Skip to content

Instantly share code, notes, and snippets.

@peterwilsoncc
Created November 8, 2021 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterwilsoncc/34817da940ca26244c816d69f54d56a2 to your computer and use it in GitHub Desktop.
Save peterwilsoncc/34817da940ca26244c816d69f54d56a2 to your computer and use it in GitHub Desktop.
Notes for WP ticket #40878
<?php
register_post_type(
'nav_menu_item',
[
// Unlisted items remain unchanged.
'map_meta_cap' => true,
'capabilities' => [
// Meta Capabilities.
'edit_post' => 'edit_post',
'delete_post' => 'delete_post',
'read_post' => 'read_post',
// Primitive Capabilities.
'read' => 'read',
'delete_others_posts' => 'edit_theme_options',
'delete_posts' => 'edit_theme_options',
'delete_private_posts' => 'edit_theme_options',
'delete_published_posts' => 'edit_theme_options',
'edit_others_posts' => 'edit_theme_options',
'edit_posts' => 'edit_theme_options',
'edit_posts' => 'edit_theme_options',
'edit_private_posts' => 'edit_theme_options',
'edit_published_posts' => 'edit_theme_options',
'publish_posts' => 'edit_theme_options',
'read_private_posts' => 'edit_theme_options',
],
]
);
register_taxonomy(
'nav_menu',
'nav_menu_item',
[
// Unlisted items remain unchanged.
'capabilities' => [
'manage_terms' => 'edit_theme_options',
'edit_terms' => 'edit_theme_options',
'delete_terms' => 'edit_theme_options',
'assign_terms' => 'edit_theme_options',
]
]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment