# SOLVED: Dynamic Data Tag in Code element: Parsing Failure

**URL:** <https://forum.bricksbuilder.io/t/solved-dynamic-data-tag-in-code-element-parsing-failure/40628>\
**Category:** Bugs\
**Tags:** v2-4-3\
**Created:** [October 16, 2026, 10:19am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-data-tag-in-code-element-parsing-failure/40628 "2026-10-16T10:19:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattHias](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matthias/32/34256_2.png) [@MattHias](https://forum.bricksbuilder.io/u/MattHias)\
**Post date:** [October 16, 2026, 10:19am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-data-tag-in-code-element-parsing-failure/40628/1 "2026-10-16T10:19:08Z")

</div>

There’s an issue with parsing Dynamic Data Tags from Code element with complex strings.

_Of course, “Execute code” and “Parse dynamic data” for Code element are toggled ON, and code is signed._

Sample Code element, NOT WORKING

```php
<?php
echo do_shortcode('[my-version-display key="{acf_software_key}" prefix="Version: "]');
?>

```

Dynamic\_Data\_Parser fails to parse the {acf\_…} tag from this complex string.  
Thus, the tag is not rendered correctly. Instead, it is passed to do\_shortcode as the original string “{acf\_software\_key}”.

I started to debug Bricks\Integrations\Dynamic\_Data\Dynamic\_Data\_Parser.  
The issue seems to arise in find\_kv\_arg\_position(), where the parentheses of “do\_shortcode(…)” are confusing the parser.

Interestingly, if I add the {acf\_…} tag in a very simple manner, the tag is parsed correctly.  
And even if I don’t use the result from that simple dummy tag line, the complex string is then rendered correctly. I assume there’s some kind of tag caching involved, but I didn’t investigate.

Sample Code element, WORKING

```php
<?php
$dummy_key = '{acf_software_key}';
echo do_shortcode('[my-version-display key="{acf_software_key}" prefix="Version: "]');
?>

```

PS:  
This is not an urgent issue for me, as I could solve it by implementing that dummy line.  
I just wanted to bring that issue to your attention.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [October 16, 2026, 11:28am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-data-tag-in-code-element-parsing-failure/40628/3 "2026-10-16T11:28:22Z")

</div>

Hi Matthias,  
Thanks for your report!

I tested with 2.4.3 with an ACF text field resolved the tag in both cases, so I cannot confirm the cause yet.

Please share a Bricks export containing the affected Code element and the ACF field-group JSON, using sample values.

Does this happen on the frontend, in the Builder, or both?

---

<div class="post-metadata">

**Author:** ![MattHias](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matthias/32/34256_2.png) [@MattHias](https://forum.bricksbuilder.io/u/MattHias)\
**Post date:** [October 16, 2026, 12:25pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-data-tag-in-code-element-parsing-failure/40628/4 "2026-10-16T12:25:21Z")

</div>

Hey Stefan,

thank you for having a look into that issue.

I have to apologize.  
I provided a very simplified code sample in this ticket, way less complex than I have it in my actual site. And I can’t easily provide an export, because it requires, an ACF field, a shortcode, and the Code element itself.

So I tried to provide a very simple code sample that shows the same behavior as I noticed on my site.  
While doing so, I got aware that the issue only appears due to some code logic, I only have on my actual site, not in the code sample I provided earlier.  
The issue comes from a PHP “if” condition syntax with curly braces.

Please test a Code element with this pretty simple code, which requires no prerequisites:

`<?php`  
` if (true) {`  
` echo 'Current Date/Time: '.`  
` date("Y-m-d H:i:s", intval('{current_date:timestamp}'));`  
` }`  
`?>`

👎

I would expect the correct date/time to be displayed.  
But the Dynamic Data Parser fails due to the PHP “if (…) {…}” construct, trying to parse everything in between the curly braces of the “if” branch.  
The resulting output in this case is “Current Date/Time: 1970-01-01 00:00:00” in Builder and frontend, resulting from an invalid timestamp.  
If I remove the “if” condition, and just leave the echo part, the output is correct.

To verify and confirm my observation, I tested with this modified code without the curly braces on the “if”:

`<?php`  
` if (true) :`  
` echo 'Current Date/Time: '.`  
` date("Y-m-d H:i:s", intval('{current_date:timestamp}'));`  
`endif;`  
`?>`

👍

That works fine.

_PS: I know the code is a pretty stupid sample. It’s just meant to demonstrate the parser issue._

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [October 19, 2026, 6:51am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-data-tag-in-code-element-parsing-failure/40628/6 "2026-10-19T06:51:39Z")

</div>

Thanks for providing another example. I reproduced the issue on the frontend with 2.4.3. Your alternative `if … endif` syntax works as a workaround.

---

<div class="post-metadata">

**Author:** ![bricks.assistant](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/bricks.assistant/32/32537_2.png) [@bricks.assistant](https://forum.bricksbuilder.io/u/bricks.assistant)\
**Post date:** [October 28, 2026, 11:44am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-data-tag-in-code-element-parsing-failure/40628/7 "2026-10-28T11:44:59Z")

</div>

We’ve addressed this in Bricks 2.4.4, now available as a one-click update in your WordPress Dashboard.

Please read the [changelog entry](https://bricksbuilder.io/release/bricks-2-4-4/) before updating, and let us know if you experience any issues.
