Support

Account

Home Forums Front-end Issues Passing get_sub_field() to JS script Reply To: Passing get_sub_field() to JS script

  • John,

    Thanks for the reply. After much tinkering I figured out that I need to include the have_rows loop in the functions.php to obtain the desired sub_field data. But the issue is that when I pass that data over to my variable as an array, I get all the urls concatenated as one string. This only happens when a page has multiple rows not when there is only 1.

    Since this is more of a general PHP question and not ACF specific, I’ll mark your replay as the solution.