Hide Bricks Templates From Non-Administrators
Removes the Bricks Templates menu for everyone except administrators, protecting headers, footers and popups built as Bricks templates.
Opens WPIDE on
Code
add_action( 'admin_menu', function () {
if ( ! current_user_can( 'manage_options' ) ) {
remove_submenu_page( 'bricks', 'edit.php?post_type=bricks_template' );
remove_menu_page( 'edit.php?post_type=bricks_template' );
}
}, 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.