Hi,
I’m trying to find a way to remove the Layout meta box on post edit pages (for non admin users). There is a solution in this thread but it doesn’t seem to work with the latest version.
Any ideas ?
Hey mike235,
Thank you for using Enfold.
Edit the post then click the Screen Options located at the top right corner of the dashboard. Disable the “Layout” metabox there.
Best regards,
Ismael
Hi Ismael,
I mean remove completely, not hide. The code you suggested in the thread I link to doesn’t seem to work anymore.
Thanks,
Mike
Hi,
Alright. Please replace the code in the functions.php file with the following.
// disable layout metabox for post
add_filter('avf_builder_boxes', 'avf_builder_boxes_mod');
function avf_builder_boxes_mod($metabox)
{
foreach($metabox as &$meta)
{
if($meta['id'] == 'layout')
{
$meta['page'] = array('page', 'portfolio');
}
}
return $metabox;
}
Best regards,
Ismael
Great, thanks a lot Ismael !