[Resolved] hide "Disable Elements" and "Sidebars" by user role with a hook

Home Forums Support [Resolved] hide "Disable Elements" and "Sidebars" by user role with a hook

Home Forums Support hide "Disable Elements" and "Sidebars" by user role with a hook

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1274777
    Oriol

    hi,
    I would like to hide to editors the ability to change page structure (use sections, sidebars and layout), in the settings of page/post editor.

    how can i do that
    with a hook?

    thanks

    #1275567
    Leo
    Staff
    Customer Support
    #1277729
    Oriol

    Hi Leo,
    thanks, I try it

    #1278047
    Leo
    Staff
    Customer Support

    Let me know 🙂

    #1396739
    Nic

    have a question with this. while this code works to prevent the editor user role from using page edit gp meta boxes:

    function limit_gp_metaboxes($cap){
    	if(current_user_can('editor')) return false;
    	return $cap;
    }
    add_filter("generate_metabox_capability","limit_gp_metaboxes");

    the same user is still able to modify gp meta boxes in elements blocks. is there another hook?

    #1396742
    Nic

    found out this will do the trick:

    function remove_elements_metabox() {
    	if(current_user_can('editor')) {
    		remove_meta_box('generate_premium_elements', 'gp_elements', 'normal');
    	}
    }
    add_action( 'add_meta_boxes', 'remove_elements_metabox', 999 );
    #1396972
    David
    Staff
    Customer Support

    Glad to hear you found the solution

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.