Navigation überspringen

[Gelöst] Need to hide the Content Metabox for non-admins

This support ticket is created vor 5 Jahren, 8 Monaten. There's a good chance that you are reading advice that it now obsolete.
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Dieses Thema enthält 0 Antworten, hat 1 Stimme.

Zuletzt aktualisiert von larryB-3 vor 5 Jahren, 8 Monaten.

Assistiert von: Shane.

Author
Artikel
#1274585
Screen Shot 2019-06-21 at 10.17.02 AM.jpg

I am using this code to hide some of toolset content on a CPT from non-admins, but don't know what to add to this to have the primary content box hidden from non-admins. They don't need to see the content box.

add_action( 'admin_head', 'wpv_custom_admin_head', 20);
function wpv_custom_admin_head() {
if ( ! current_user_can( 'activtate_plugins' ) ) { // Only run if the user is an Editor or lower.
$slugs = array(
'post',
'page',
'suspension',
);
remove_meta_box( 'wpddl_template', $slugs, 'side' );
remove_meta_box( 'views_template', $slugs, 'side' );
}
}