-
pesiiin
Hi, is there any possibility to this shortcode (or maybe any shortcode) works inside GB Query loop block ?
https://jonathanjernigan.com/dynamically-embed-youtube-video-in-acf-field-in-gutenberg/
Thanx Radek -
Hi there,
You need to use the
render_block()
filter to make itdo_shortcode()
.For example, you can add a headline block with the class
my-shortcode
, then you add this PHP code:add_filter( 'render_block', function( $block_content, $block ) { if ( ! empty( $block['attrs']['className'] ) && 'my-shortcode' === $block['attrs']['className'] ) { $block_content = do_shortcode('[your_shortcode]'); } return $block_content; }, 10, 2 );
-
pesiiin
Hi Ying, just letting You know this works perfect.
Thanx a lot. Radek -
Glad to hear that 🙂
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.