Hello
In my web site, some users have access to the blog (multi author), and can publish articles.
However I had simplified the back office for them, by removing the layout boxes, yoast box, etc … like this:
// disable layout metabox for post
add_filter('avf_builder_boxes', 'avf_builder_boxes_mod');
function avf_builder_boxes_mod($metabox){
isSiteAdmin();
if( isSiteAdmin() ){
foreach($metabox as &$meta) {
if($meta['id'] == 'layout') {
$meta['page'] = array('page', 'portfolio');
}
}
return $metabox;
}
}
Now that I have updated the theme and wordpress core, this code no longer seems to work.
Do you have a tip?
Thank you in advance !
Ok, forget, I’ve found :
function my_remove_meta_boxes2() {
isSiteAdmin();
if( !isSiteAdmin() ){
remove_meta_box( 'layout', 'post', 'side' );
remove_meta_box( 'wpseo_meta', 'post', 'normal' );
}
}
add_action( 'add_meta_boxes', 'my_remove_meta_boxes2', 11);
Thanks
Hi,
I’m glad you resolved this. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon