Remove settings media 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' => [
'settings.media',
'settings.media' => (string) $route,
'settings.media.title' => (string) $title,
'settings.media.title.[menu, page]' => (string) $title,
'settings.media.tabs',
'settings.media.tabs.[screen-options, help]',
'settings.media.sizes',
'settings.media.uploads',
],
];
Remove from menu;
<?php
return [
'wp-admin.$role|$username' => [
'settings.media',
],
];
Remove from menu and enforce a page redirect;
<?php
return [
'wp-admin.$role|$username' => [
'settings.media' => 'posts',
],
];