The oik-block/blockinfo and oik-block/blocklist blocks from the oik-blocks plugin both support links to block variations
but the [blocks] shortcode does not.
Both of these blocks create links to all the block's variations.
I need a way to refer to an individual block variation, such as the Post Tags variation of the Post Terms block.
Requirement
To be able to create inline links to blocks which are implemented as variations.
Proposed solution
[x] Extend the [blocks] shortcode to cater for block variations.
The syntax of the variation would be prefix/block-name:variation-name
eg core/post-terms:post-tags for Post Tags and
core/post-terms:post-categories for Post Categories
On detecting the colon in the block name the shortcode would first look for the block, then for the variation.
Use the oiksc_get_block() function.
The
oik-block/blockinfo
andoik-block/blocklist
blocks from the oik-blocks plugin both support links to block variations but the[blocks]
shortcode does not.Both of these blocks create links to all the block's variations.
I need a way to refer to an individual block variation, such as the Post Tags variation of the Post Terms block.
Requirement
To be able to create inline links to blocks which are implemented as variations.
Proposed solution
[blocks]
shortcode to cater for block variations.The syntax of the variation would be
prefix/block-name:variation-name
eg
core/post-terms:post-tags
for Post Tags andcore/post-terms:post-categories
for Post CategoriesOn detecting the colon in the block name the shortcode would first look for the block, then for the variation. Use the
oiksc_get_block()
function.