Dear,
I’m using the following code in functions.php to disable metaboxes for each post type if user is not administrator:
if(!function_exists('remove_meta_boxes')){
function remove_meta_boxes() {
if( !current_user_can('administrator') ){
remove_meta_box('woocommerce-product-360-images','product','side'); // 360 gallery
remove_meta_box('woodmart_sguide_dropdown_template','product','side'); // woodmart size guide
remove_meta_box('xts_product_metaboxes','product','normal'); // woodmart product metabox
remove_meta_box('xts_page_metaboxes','page','normal'); // woodmart page and post metabox
}}}
add_action('do_meta_boxes','remove_meta_boxes');
It works for the size guide but the xts product and page metaboxes keep showing.
screenshot: https://media.studio84.be/Wnum6ZKQ
How can I disable this the right way?
Thanks in advance.
Regards, Bart