[Resolved] Inline dynamic data

Home Forums Support [Resolved] Inline dynamic data

Home Forums Support Inline dynamic data

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #2350118
    Fernando
    Customer Support

    You could also add add-parenthesis the the class list of the Headline Block, and then add the parenthesis manually to the Headline Block itself through this code:

    add_filter('generateblocks_dynamic_content_output', function($content, $attributes, $block){
    	if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'add-parenthesis' ) !== false ) {
    		$content = '(' . $content .')';
    	}
    	return $content;
    }, 10, 3);

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

    #2350131
    Fernando
    Customer Support

    Another solution would be to add add-parenthesis to the class list of the Headline Block, and then add this snippet:

    add_filter('generateblocks_dynamic_content_output', function($content, $attributes, $block){
    	if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'add-parenthesis' ) !== false ) {
    		$content = '(' . $content .')';
    	}
    	return $content;
    }, 10, 3);

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

    #2350334
    Gabriel

    Thanks for the other workarounds.

    #2350336
    Fernando
    Customer Support

    You’re welcome Gabriel!

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.