Skip Navigation

[Resolved] Need to hide the Content Metabox for non-admins

This support ticket is created 5 years, 5 months ago. 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)

This topic contains 0 replies, has 1 voice.

Last updated by larryB-3 5 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#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' );
}
}