diff --git a/functions.php b/functions.php index ea73337..12ad3a0 100644 --- a/functions.php +++ b/functions.php @@ -127,6 +127,23 @@ function fizzie_front_page_template( $template ) { } add_filter( 'frontpage_template', 'fizzie_front_page_template' ); +/** + * Filters the rendered shortcode block. + * + * @param $content + * @param $parsed_block + * @param $block + * @return mixed|string + */ +function fizzie_render_block_core_shortcode( $content, $parsed_block, $block ) { + $content = do_shortcode( $content ); + return $content; +} + +add_filter( 'render_block_core/shortcode', 'fizzie_render_block_core_shortcode', 10, 3, ); +add_filter( 'render_block_core/paragraph', 'fizzie_render_block_core_shortcode', 10, 3, ); + + require_once __DIR__ . '/includes/block-overrides.php'; diff --git a/includes/block-overrides.php b/includes/block-overrides.php index 8058b9d..276f8c4 100644 --- a/includes/block-overrides.php +++ b/includes/block-overrides.php @@ -25,6 +25,7 @@ require_once __DIR__ . '/navigation-link.php'; //require_once __DIR__ . '/post-hierarchical-terms.php'; //require_once __DIR__ . '/block.php'; +//require_once __DIR__ . '/shortcode.php'; /** * Hook into register_block_types_args before WP_Block_Supports @@ -49,5 +50,6 @@ function fizzie_register_block_type_args( $args ) { $args = fizzie_maybe_override_block( $args,'core/navigation-link', 'render_block_core_navigation_link' ); //$args = fizzie_maybe_override_block( $args,'core/post-hierarchical-terms', 'render_block_core_post_hierarchical_terms' ); //$args = fizzie_maybe_override_block( $args,'core/block', 'render_block_core_block' ); + //$args = fizzie_maybe_override_block( $args,'core/shortcode', 'render_block_core_shortcode' ); return $args; } \ No newline at end of file diff --git a/includes/shortcode.php b/includes/shortcode.php new file mode 100644 index 0000000..2e1c669 --- /dev/null +++ b/includes/shortcode.php @@ -0,0 +1,18 @@ +