Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'admin_footer' , 'hide_bb_logic_root_and_builder_locations' );
- /**
- * callback to hide the logic rules and unwanted builder locations
- * make sure an administrator still sees the options
- *
- * IMPORTANT: please take note that a clever user can still open up inspector and disable the styles
- * and the options will show up again.
- */
- function hide_bb_logic_root_and_builder_locations() {
- $current_user = get_current_user_id();
- $userdata = get_userdata( $current_user );
- if ( in_array( 'administrator' , $userdata->roles ) ) return;
- echo '<style>' .
- '#bb-logic-root {display: none;}' .
- 'ul[id*="select2-fl-theme-builder-location"] li[aria-label] { display: none; }' .
- 'ul[id*="select2-fl-theme-builder-exclusion"] li[aria-label] { display: none; }' .
- 'li[id*="select2-fl-theme-builder-location"]:not([id*="select2-fl-theme-builder-location-objects"]):not([id*="\"id\":\"page\""]) { display:none;}'.
- 'li[id*="select2-fl-theme-builder-exclusion"]:not([id*="select2-fl-theme-builder-exclusion-objects"]):not([id*="\"id\":\"page\""]) { display:none;}'.
- 'ul[id*="select2-fl-theme-builder-location"] li[aria-label="Pages"],' .
- 'ul[id*="select2-fl-theme-builder-location"] li[aria-label="false"] { display: unset; }'.
- 'ul[id*="select2-fl-theme-builder-exclusion"] li[aria-label="Pages"],' .
- 'ul[id*="select2-fl-theme-builder-exclusion"] li[aria-label="false"] { display: unset; }'.
- '</style>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement