Hide the Divi Library From Non-Administrators
Removes the Divi Library menu (saved layouts, sections and modules) for everyone except administrators, so global elements are not changed by accident.
Opens WPIDE on
Code
add_action( 'admin_menu', function () {
if ( current_user_can( 'manage_options' ) ) {
return;
}
remove_submenu_page( 'et_divi_options', 'edit.php?post_type=et_pb_layout' );
remove_menu_page( 'edit.php?post_type=et_pb_layout' );
}, 999 );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.