Title: Issue when using editor.BlockListBlock block hook
Last modified: February 6, 2023

---

# Issue when using editor.BlockListBlock block hook

 *  Resolved [rose18](https://wordpress.org/support/users/rose18/)
 * (@rose18)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-when-using-editor-blocklistblock-block-hook/)
 * Hi,
 * This is a great plugin that help hide blocks without having to delete it in the
   editor, but it’s causing an issue when I am these WordPress hooks to extend the
   core blocks.
 * I am using these WordPress block hooks:
    - blocks.registerBlockType
    - blocks.getSaveContent.extraProps
    - editor.BlockEdit
    - editor.BlockListBlock
 * I was able to add an extra ToggleControl field.
   My issue happens when I use editor.
   BlockListBlock ([https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/#editor-blocklistblock](https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/#editor-blocklistblock))
   to add a class name in the editor.
 * Once I enable my custom toggleControl to true, it adds in my custom class name,
   but is also add in this plugin block visibility class name (block-visibility__has-
   visibility). Now this block has these contextual indicator styles showing up (
   red outline, opacity set to 40% and the eye icon on the top right) even though
   this block visibility is set to false.
 * Screenshots below:
 * ![](https://i0.wp.com/snipboard.io/pWVwaM.jpg?ssl=1)
 * ![](https://i0.wp.com/snipboard.io/ZJYPic.jpg?ssl=1)
 * The ‘Enable Drop Shadow’ ToggleControl is a custom control that I’ve created 
   using the WordPress block hooks. When I removed the ‘editor.BlockListBlock’ hook
   in my code the issue is gone.
 * I would like to know is there a way to fix this issue?
 * Below is the editor.BlockListBlock code:
 *     ```wp-block-code
       addFilter(
         'editor.BlockListBlock',
         'theme/shadow-class',
         shadowBlockListBlock
       );
   
   
       const shadowBlockListBlock  = createHigherOrderComponent( ( BlockListBlock ) => {
           return ( props ) => {
   
               if ( ! enableDropShadowControlOnBlocks.includes( props.name ) ) {
                   return (
                       <BlockListBlock { ...props } />
                   );
               }
               const { attributes } = props;
               const { hasDropShadow } = attributes;
   
       			return <BlockListBlock { ...props } className={ hasDropShadow ? 'has-drop-shadow' : '' } />;
           };
       }, 'shadowBlockListBlock' );
       ```
   
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Nick Diego](https://wordpress.org/support/users/ndiego/)
 * (@ndiego)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-when-using-editor-blocklistblock-block-hook/#post-16442589)
 * Hi [@rose18](https://wordpress.org/support/users/rose18/),
 * Thank you for this detailed support ticket. I have tested your code and was able
   to replicate the issue. It appears that a bug was introduced in the last version,
   which attempted to resolve a separate issue related to the `editor.BlockListBlock`
   filter.
 * That said, I have just pushed version 2.5.4 which should resolve the issue for
   you. Please let me know if I can be of further assistance.
 * Best,
   Nick
 *  Thread Starter [rose18](https://wordpress.org/support/users/rose18/)
 * (@rose18)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-when-using-editor-blocklistblock-block-hook/#post-16444991)
 * Thank you [@ndiego](https://wordpress.org/support/users/ndiego/) ! The latest
   version help fixed the issue!
 * Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Issue when using editor.BlockListBlock block hook’ is closed to new replies.

 * ![](https://ps.w.org/block-visibility/assets/icon-256x256.png?rev=3122657)
 * [Block Visibility — Conditional Visibility Control for the Block Editor](https://wordpress.org/plugins/block-visibility/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/block-visibility/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/block-visibility/)
 * [Active Topics](https://wordpress.org/support/plugin/block-visibility/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-visibility/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-visibility/reviews/)

## Tags

 * [blocks](https://wordpress.org/support/topic-tag/blocks/)

 * 2 replies
 * 2 participants
 * Last reply from: [rose18](https://wordpress.org/support/users/rose18/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/issue-when-using-editor-blocklistblock-block-hook/#post-16444991)
 * Status: resolved