-
AuthorPosts
-
June 17, 2014 at 2:44 am #279791
Hi there!
How do I set it in a way that anyone below administrator rank is not able to use the drag and drop features (Avia features disabled) yet they are able to do the normal theme way to editing pages/posts?
Regards and cheers!
KayzelJune 17, 2014 at 6:35 am #279854Hey!
Try adding this at the very end of your theme functions.php file:
function disable_alb_for_non_admin_users() { if ( !current_user_can( 'manage_options' ) ) { ?> <style>#avia-builder-button{ display: none; } </style> <?php } } add_filter('admin_head', 'disable_alb_for_non_admin_users');
Cheers!
JosueJune 17, 2014 at 11:04 am #279926Hi it didn’t worked uh! Editor rank are still able to utilize the functions!
Regards,
KayzelJune 17, 2014 at 11:05 am #279927Hi it didn’t worked uh! Editor rank are still able to utilize the functions!
Regards,
KayzelJune 17, 2014 at 12:27 pm #279948Hi!
You can use this code:
add_action('admin_enqueue_scripts', 'avia_deactivate_builder', 10); function avia_deactivate_builder() { $is_post_edit_page = in_array(basename($_SERVER['PHP_SELF']), array('post.php', 'page.php', 'page-new.php', 'post-new.php')); if($is_post_edit_page && !current_user_can('manage_options')) { if(!current_user_can('manage_options')) { echo "<style>#avia-builder-button{display: none !important;}</style>"; } } }
to hide the “Advanced Editor” for non-administrators on pages where no advanced layout is used. Note that you can’t disable the builder on pages which use an advanced layout because you can’t mix the content of the “standard” editor with “advanced layout” templates and the editor would just break the page with the “standard editor”. If you want to avoid that your editors/contributes can use the builder on pages which already use advanced layouts you must block the access to these pages completely. Tbh I’m not sure how this can be done but I guess this plugin: https://wordpress.org/plugins/advanced-access-manager/ may help you.
Best regards,
PeterJune 17, 2014 at 1:36 pm #279977Ah I tried that code on a editor rank but it didn’t work. I guess cause im all using advanced editor! I used advanced access manager, it did cleared most of them off. But is there any other possible methods or workabout methods to disallow ranks below admin from having avia controls? :)
Thanks a lot!June 17, 2014 at 5:58 pm #280127I don’t think there is a easy way to do that to be honest. The best thing you can do is restrict access to the Pages that use ALB.
Regards,
JosueJune 17, 2014 at 7:00 pm #280163What about setting selected pages restricted from rank editor and below?
Cheers!!June 17, 2014 at 7:56 pm #280190Hey!
You can suggest this feature here: https://kriesi.at/support/enfold-feature-requests/ and if a lot of other users vote for it we’ll look into it.
Regards,
PeterJune 20, 2014 at 8:06 pm #281762This reply has been marked as private.June 20, 2014 at 9:03 pm #281790Hello!
It is possible but it would require a heavy customization to the theme, unfortunately that’s beyond the scope of the support we can offer. If you really need it try contacting a developer.
Cheers!
JosueJune 21, 2014 at 12:14 pm #281964This reply has been marked as private.June 21, 2014 at 5:38 pm #282000Hey!
You could try something like this function:
add_action('admin_enqueue_scripts', 'avia_deactivate_builder', 10); function avia_deactivate_builder() { $is_post_edit_page = in_array(basename($_SERVER['PHP_SELF']), array('post.php', 'page.php', 'page-new.php', 'post-new.php')); if($is_post_edit_page && !current_user_can('manage_options')) { if(!current_user_can('manage_options')) { echo "<style>#avia_builder > .inside > .avia_meta_box_visual_editor > .shortcode_button_wrap { visibility: hidden; }</style>"; } } }
But I’m not really sure what effects that may have. The user can still manipulate the layout and access templates etc. If you want further customization of the editor for the non-admins you’ll need to look into a freelance developer from somewhere like Codeable.io .
Best regards,
Devin -
AuthorPosts
- You must be logged in to reply to this topic.