ACF Repeater Field in a Custom Looper

Hi,

I am trying to loop an ACF repeater field following the instructions in this thread, but it is for some reason not working.

This is most likely another related thread, but I cannot open it although I am logged in to the forum. Getting this message: “Oops! That page doesn’t exist or is private.”
https://theme.co/forum/t/new-looper-providers-acf-repeater-field/84558/8

Anyways, are there any circumstances that make the solution in the above not work? As far as I understand from Alexander’s replies, there are some limitations when it comes to looping ACF fields, but my test looper and ACF field are very simple. I couldn’t figure out why it is not working.

I would appreciate it if you can take a look at it. The details are in the secure note.

Thanks in advance.

Hello Gunes,

The thread is from the Beta forum. Here is the response of Alexander:

Just a quick thought that may help here after seeing your code. Try this:

add_filter( 'cs_looper_custom_my_acf_repeater', function( $result, $args ) {
    return get_field( $args['field'] );
}, 10, 2);

Then you can set the hook to my_acf_repeater and use the Params (JSON Editor) to include this:

{
  "field": "systemer"
}

That will give you the ability to name your repeater field instead of needing to defined multiple custom loopers on the PHP side.

Kindly let us know if this helps.

RueNel,

Thank you so much. Now it starting working! The apostrophe on the original thread was not compatible with my system (Mac OS) so the code was not working. It started working after pasting Alexander’s snippet.

Thank you so much!

Hi Gunes,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.