-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Description
In the documentation: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style
Note: An option to pass also an array of styles exists since WordPress 5.9.0.
passing an array of styles is possible since 5.9.0. However, I'm on WordPress 6.1 and there are some errors and notices:
[09-Aug-2022 11:04:58 UTC] PHP Notice: Array to string conversion in C:\laragon\www\dev\wp-includes\block-editor.php on line 340
[09-Aug-2022 11:04:58 UTC] PHP Warning: explode() expects parameter 2 to be string, array given in C:\laragon\www\dev\wp-includes\class.wp-dependencies.php on line 186
[09-Aug-2022 11:04:58 UTC] PHP Notice: Trying to access array offset on value of type null in C:\laragon\www\dev\wp-includes\class.wp-dependencies.php on line 187
Both the styles are enqueued, though.
Step-by-step reproduction instructions
- Register a block with an array of styles. E.g.
register_block_type(
'wpfda/block',
[
'style' => [ 'wpfda-style', 'wpfda-editor-style' ]
]
- Go to new post page.
- See the error.
Screenshots, screen recording, code snippet
No response
Environment info
Gutenberg is not installed.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No