Thanks James. Perhaps a note in the docs would be helpful to others in the same situation.
Actually it seems like the parent repeater field simply returns the number of subfields as well, no idea why it doesn’t work as described. I’m using ACF v4.4.8 w/ Repeater field add-on v1.1.1.
I just ran into a similar problem and concluded, without any evidence, that it’s because the repeater field is a subfield of another repeater field. Perhaps this is the case here as well.
@nicholaspetersen Try just counting $my_fields instead of $my_fields[‘value’].
Never before have been dreams been so quickly crushed by a thread! +1
I dug into the code and found that WP is looking for a field which matches this jQuery selector input[id*="-title"] when appending the widget title, so you have two choices:
1) Change the key of the custom field so that it ends in the string “-title”. This only seems possible if you’re registering your custom fields with code, not through the admin interface.
2) Add the title field manually in your widget’s form() method (and widget() method if you’re displaying it on the frontend). I reused some code I found in default-widgets with good results.
Good luck,
Marc
What happens if you try “parent_slug” instead of “parent”?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.