Load CSS/Javascript in frontend conditionally if block is used
Well, the styles and scripts you register in your php register_block_type call should only be loaded when the block is in use if i recall correctly. If you want to load additional scripts or styles to be enqueued only if there is a block of type “my-awesome/block-type”, you can use the has_block function in your … Read more