Hello,
I’ve got a bit of a special question I guess and I hope you’ve got a solution for me or at least an approach to solve the problem.
I installed Advances Access Manager to control the users’ access. Though it’s a website for a sports club there are many different users who may upload contents in their department’s pages. On every page I have inserted the Avia Layout Architect element Fullwidth sub menu.
Now I want to lock these fullwidth sub menus so that nobody expect me (the administrator) can delete or edit it. Is there any possibility to achive this without blocking the whole Avia Layout Builder? The memebers should still be able to insert other avia elements.
I thought of inserting some code that only allows the administrator to edit or delete the fullwidth sub menu but I don’t know how to achieve this.
Thank you in advance!
Regards.
Hey ping-pong,
Thank you for using Enfold.
You can hide the element by adding the following code in the functions.php file.
/* hide submenu element */
function admin_head_mod() {
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
echo '<style type="text/css">.av_submenu { display: none !important; }</style>';}
}
add_action('admin_head', 'admin_head_mod');
This code will hide the submenu element if the user role is set to “author”. You can also use the current_user_can function.
// https://codex.wordpress.org/Function_Reference/current_user_can
Best regards,
Ismael
Hello Ismael,
it works perfectly fine even with the current_user_can function! Thank you very much! :) :)
Best regards.
Hi!
Happy we could solve it.
Please feel free to let us know if anyhing else is needed.
Thanks a lot
Regards,
Basilis