You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This essentially works as a PHP-based method of registering custom block variations. This would be a lightweight tutorial for anyone who wants to pick it up and showcase a new WP 6.5 feature. Of course, I'm always happy to take this one on myself too.
Some possible limitations I've seen in my early testing so far:
It doesn't seem that you can pass a custom SVG to the icon property. I believe this may only be limited to dashicons.
The isActive check seems to be limited to the array method of checking attributes.
Example
Here's an example variation on the Spacer block that's specific to my theme, but it's just a PoC:
Discussed in #228
WordPress 6.5 is shipping with a new
get_block_type_variations
filter hook: https://github.com/WordPress/wordpress-develop/blob/4ba0963a1f61d062d7345e429c823f3eb5ab5f78/src/wp-includes/class-wp-block-type.php#L608-L616This essentially works as a PHP-based method of registering custom block variations. This would be a lightweight tutorial for anyone who wants to pick it up and showcase a new WP 6.5 feature. Of course, I'm always happy to take this one on myself too.
Some possible limitations I've seen in my early testing so far:
icon
property. I believe this may only be limited to dashicons.isActive
check seems to be limited to the array method of checking attributes.Example
Here's an example variation on the Spacer block that's specific to my theme, but it's just a PoC:
The text was updated successfully, but these errors were encountered: