Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #550315

    Hello,

    First of all, thank you for the update, the new demo is great.

    However, I’d like to hide the “layout” mata box on post type page (post-new.php) on other user’s roles, except administrator who could still see this when create the new post.

    I think it might prevent the customization of sidebar setting, footer setting from other roles who is using the new post page (they are writer, editor etc.)

    Thanks in advance

    #551552

    Hey Pear!

    Thank you for using Enfold.

    Please add this in the functions.php file:

    add_filter('avf_builder_boxes','avf_builder_boxes_mod', 50);
    function avf_builder_boxes_mod($boxes) {
        if(!current_user_can('activate_plugins')) {
            foreach($boxes as $box) {
                if($box['title'] == 'Layout') {
                    unset($box['page']);
                    $box['page'] = array('portfolio', 'page', 'product');
                    $newbox = $box['page'];
                }
            }
    
            $counter = 0;
            foreach($boxes as $box) {
                if($box['title'] == 'Layout') $boxes[$counter]['page'] = $newbox;
        		$counter++;
            }
        }
    
        return $boxes;
    }

    Cheers!
    Ismael

    #552145

    Thank you ~ :)

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Hide layout metabox for other user roles’ is closed to new replies.