• Resolved dreadlock

    (@dreadlock)


    is there a way we can integrate a pods fields to the built-in wordpress blocks like the paragraph block? so we can style it from the block settings

    • This topic was modified 1 year, 10 months ago by dreadlock.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Paragraph blocks render shortcodes, so you can enter [pods]{@field_name}[/pods] into a paragraph block and it will render the field value.

    Plugin Support Paul Clark

    (@pdclark)

    In testing, this also worked with heading and list blocks.

    For more complicated blocks that don’t support shortcodes, it would be possible to add shortcode support by adding apply_shortcodes() to the render_block filter.

    Not tested, but if there’s other blocks that don’t support shortcodes, this should work to add shortcodes to all blocks:

    <?php
    add_filter(
    	'render_block',
    	function( $block_content, $block ) {
    		return apply_shortcodes( $block_content );
    	},
    	10,
    	2
    );

    See this comment for an example of how to restrict the above function to only some blocks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘built-in block integration’ is closed to new replies.