Detecting usage of a widget block on a page.
-
Hello community!
I have one question that may be solved by someone here so I prefered to do this instead of opening an issue on GitHub. It concerns the new Widget Block Editor, introduced on WP 5.8.
As a plugin developer, I use the
has_block()
function, to detect if a certain block is present in the current page, so I can decide if I have to load ourjavascript
andcss
. This was working fine, but I noticed that it won’t do the job once footer and sidebar widgets areas are edited by the block editor.Is there any way for me to check if one of my blocks was inserted in a certain wdiget area, in a certain page, on time to at least unregister unecessary scripts and styles?
- The topic ‘Detecting usage of a widget block on a page.’ is closed to new replies.