Saltar navegación

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

This support ticket is created hace 5 años, 6 meses. 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)

Este tema contiene 0 respuestas, tiene 1 mensaje.

Última actualización por larryB-3 hace 5 años, 6 meses.

Asistido por: Shane.

Autor
Mensajes
#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' );
}
}