Forum Replies Created

Viewing 1 replies (of 1 total)
  • +1 for hiding metabox, amended Ricks code slightly to check to see if the user is an administrator, if so keep the meta box and hide for all other user roles.

    //Remove Litespeed Page Options for non-admin
    function remove_ols_metabox() {
        if ( is_admin() && !current_user_can('administrator') ) {
            $args = array(
               'public' => true,
            );
    
            $post_types = get_post_types( $args ); 
            foreach ( $post_types  as $post_type ) {
                remove_meta_box( 'litespeed_meta_boxes', $post_type, 'side' );
            }
        }
    }
    add_action( 'add_meta_boxes', 'remove_ols_metabox', 999 );
Viewing 1 replies (of 1 total)