Hi there,
for the GP Dynamic Text type you would need to use the generate_dynamic_element_text
filter.
For example.
Give the Headline block that you want to filter a CSS Class eg. dynamic-title
Then you can use that in this PHP Snippet
add_filter( 'generate_dynamic_element_text', function( $text, $block ) {
if ( ! empty( $block['attrs']['className'] ) && 'dynamic-title' === $block['attrs']['className'] ) {
$before = 'your before content';
$after = 'your after content'
$text = $before . $text . $after;
}
return $text;
}, 10, 2 );