-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
[Block] BlockThe "Reusable Block" BlockThe "Reusable Block" Block[Feature] ParsingRelated to efforts to improving the parsing of a string of data and converting it into a different fRelated to efforts to improving the parsing of a string of data and converting it into a different f[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
If a block is inside a reusable block, has_block doesn't return true.
Steps to reproduce the behavior:
-
Add a block inside a reusable block. (Let's say prfx/myblock)
-
Add action in plugins php file to wp_enqueue_scripts
if (has_block('prfx/myblock')) { wp_register_script('my-script', plugins_url( 'dist/assets/myscript.min.js', dirname( __FILE__ )), array(), null, true ); wp_enqueue_script('my-script'); } -
At this point the script is not loaded to site, but the block is in the page.
-
Add the block to the page separate/outside to reusable block
-
Now the script loads.
Could has_block function also validate with blocks inside reusable blocks?
Desktop:
- Windows 10
- Firefox 70.0.1
- Gutenberg Version 6.8.0
cfaria, MatzeKitt, tyrann0us, websupporter, kurtrank and 5 more
Metadata
Metadata
Assignees
Labels
[Block] BlockThe "Reusable Block" BlockThe "Reusable Block" Block[Feature] ParsingRelated to efforts to improving the parsing of a string of data and converting it into a different fRelated to efforts to improving the parsing of a string of data and converting it into a different f[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended