Remove posts item components.
- Parent items remove child items.
- For concise documentation,
option.[x, y]
has been abbreviated fromoption.x, option.y
.
<?php
return [
'wp-admin.$role|$username' => [
'posts.item',
'posts.item' => (string) $route,
// block-editor
'posts.item.add',
'posts.item.add.[
search,
preview,
headers,
tips,
grid,
icons,
],'
'posts.item.add.blocks',
'posts.item.add.blocks.[
text,
media,
design,
widgets,
theme,
embeds,
],'
'posts.item.editor',
'posts.item.author',
'posts.item.excerpt',
'posts.item.trackbacks',
'posts.item.custom-fields',
'posts.item.discussion',
'posts.item.link',
'posts.item.revisions',
'posts.item.featured-image',
'posts.item.editor',
'posts.item.categories',
'posts.item.tags',
'posts.item.sticky',
'posts.item.revisions',
'posts.item.format',
// classic
'posts.item.tabs',
'posts.item.tabs.[screen-options, help]',
],
];
Remove from menu;
<?php
return [
'wp-admin.$role|$username' => [
'posts.item',
],
];
Remove from menu and enforce a page redirect;
<?php
return [
'wp-admin.$role|$username' => [
'posts.item' => 'pages',
],
];