Dynamic data not rendered correctly on image element

Hi,

When rendering a dynamic tag on an image element (image context), ensure it’s returning an array.

Example:

add_filter('bricks/dynamic_data/render_tag', function($tag, $post, $context = 'text') {
    global $post;

    switch ($tag) {
        case 'logo_image':
			$value = !empty( $post->logo_image ) ? $post->logo_image : '';
			if ( $context === 'image' ) {
				$value = ( !empty( $value ) ) ? [ $value ] : [];
			}
			return $value;
           break;
        case 'logo_width':
            return !empty($post->logo_width) ? $post->logo_width : '';
           break;
    }
    return $tag;
}, 10, 3);

Regards,
Jenn

1 Like