-
AuthorPosts
-
October 9, 2015 at 7:06 pm #516635
Hi,
is possible to hide some elements of the layout builder and the ability to create template page for editors users?
I need to restrict most of the elements of the layout builder for editors and I need that they can load the template (that one of the builder) but not change or create others.
Thank in advance for your support,
regardsOctober 11, 2015 at 12:07 pm #516925Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_action('admin_head', function() { if(current_user_can('editor')){ ?> <style> a.save-template-button.button, span.avia-delete-template { display: none; } </style> <?php } });
Cheers!
JosueOctober 12, 2015 at 3:16 pm #517398Hi,
thanks, like this the button save and delete are hidden, great.
Do you have a similar solution for the element of the layout builder? I have to hide the most and leave only a few.
Thanks for your support
October 12, 2015 at 3:24 pm #517404October 12, 2015 at 3:48 pm #517434Hi,
I need to keep:
Text block
Separator/whitespace
Special Heading
Image
Gallery
Google MapOnly this, all the other elements must be hidden.
And if is possible I need to hide the function Insert theme shortcode in the default editor.
Thank’s a lot for your support ;)
October 13, 2015 at 2:44 am #517804Hi!
Please try this:
add_action('admin_head', function() { if(current_user_can('editor')){ ?> <style> .shortcode_insert_button { display: none; } a[href="#avia_sc_text"], a[href="#avia_sc_hr"], a[href="#avia_sc_heading"] a[href="#avia_sc_image"], a[href="#avia_sc_gallery"], a[href="#avia_sc_gmaps"] { display: block; } </style> <?php } });
Cheers!
IsmaelOctober 13, 2015 at 12:05 pm #518008Thank you!
It works fine but displays only “text” “spaces” “gallery” and “google map”
Are missing the “special headig” and “image” despite being included in the codeThanks for support
October 13, 2015 at 12:13 pm #518014There’s a typo, try with this one:
add_action('admin_head', function() { if(current_user_can('editor')){ ?> <style> .shortcode_insert_button { display: none; } a[href="#avia_sc_text"], a[href="#avia_sc_hr"], a[href="#avia_sc_heading"], a[href="#avia_sc_image"], a[href="#avia_sc_gallery"], a[href="#avia_sc_gmaps"] { display: block; } </style> <?php } });
October 13, 2015 at 12:35 pm #518027ok now it works!
just for curiosity, what is the difference between the two blocks of code? They look identical…If I can, i have another request.
Is possible also to hide the button to enter the theme shortcode in the standard editor?Thanks again
October 13, 2015 at 12:45 pm #518036There was a missing comma between the image/heading selectors. To disable the Magic Wand tool add the following to CSS code:
div#mceu_15 { display: none; }
Best regards,
JosueOctober 13, 2015 at 1:30 pm #518059Perfect!
Thanks a lot!October 13, 2015 at 3:48 pm #518136You are welcome, glad to help :)
Regards,
JosueOctober 14, 2015 at 2:05 pm #518658Hi, I have a problem with the layout builder in the post, if I use it the panel where I have to choose the image format disappeared and the featured image is not visible in the front end even if it is loaded and visible in the back end. I suppose that this must be a bug, do you have a solution for it?
Thanks
October 14, 2015 at 10:20 pm #518955Hi!
Please create another topic regarding the issue, we’ll look into it.
Regards,
JosueMarch 13, 2017 at 2:44 pm #760029Hey,
I hope it’s okay to answer to this topic.
I’ve got the same problem but it doesn’t seem to work any longer with the following code you provided for hiding the templates in avia layout architekt.add_action('admin_head', function() { if(current_user_can('editor')){ ?> <style> a.save-template-button.button, span.avia-delete-template { display: none; } </style> <?php } });
Can you provide a updated code which works on the newer enfold versions?
Thanks in advance!
Regards.March 14, 2017 at 6:40 am #760450Hi,
I think the code is supposed to only affect the editor role, did you try logging in with a user which has that role?
Best regards,
RikardMarch 14, 2017 at 2:07 pm #760720Hi,
my fault, sorry. I have the advances access manager and overlooked that the user I logged in with for testing isn’t an editor but a self-added role. When I replace “editor” with the right role it works perfectly fine.What code snippet do I have to add so that the user also can’t load templates?
Best regards.
March 20, 2017 at 7:02 am #763507Hi,
Sorry for the late reply. You can try hiding the button with CSS:
add_action('admin_head', 'hide_template_button_for_editor_role'); function hide_template_button_for_editor_role() { if(current_user_can('editor')){ echo '<style> .avia-template-save-button-container { display:none !important; } </style>'; } }
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.