SOLVED: Using a variable in custom function inside a query loop doesn't work

I have a custom function that returns a string.
For simplicity purposes, I changed it to this:
function get_customer_slug($user_id){
return ‘custom-text’;
}

This is how I call it: {echo:get_customer_slug({wp_user_id})}
If I use it in a Basic Text, it outputs ‘custom-text’ as expected. I also tried adding a var_dump and I can see the string outputted when doing the query, so it’s being called. But the query doesn’t show the posts filtered by it.

If I try to replace the echo with the actual string, the posts show as expected. Example: {echo:get_customer_slug(1)}


Not sure if important, but the query is for a CPT and the Taxonomy is from Happy Files.
I tried disabling all plugin except for Happy Files.

Hi Vale,
Thanks so much for your report!

I reproduced the issue and added it to our bug tracker.
We already have some other reports about nested dynamic data tags in various places, which unfortunately do not work either.

Best regards,
timmse

1 Like

Hi Vale,

We’ve fixed this issue in Bricks 1.9.8 beta, now available as a manual download in your account (see changelog).

Please let us know if you are still experiencing issues.

As with any beta release, please do not use it on a production or live website. It is only meant for testing in a local or staging environment.