Home › Forums › General Issues › Creating repeater problematically
Hi,
I am trying to add repeater problematically.
Can you please tell me what’s wrong with this out put array?
I am getting a lot of warnings on it, and the group is not appearing correctly in the back-end:
(adding the fields manually will work BTW)
Array
(
[key] => faq_page
[title] => Faq page
[fields] => Array
(
[key] => faq_page_repeatable
[name] => faq_page_repeatable
[label] => Faq page Repeatable
[type] => repeater
[layout] => table
[button_label] => Add Row
[sub_fields] => Array
(
[0] => Array
(
[key] => question
[label] => Question
[name] => question
[type] => wysiwyg
)
[1] => Array
(
[key] => answer
[label] => Answer
[name] => answer
[type] => wysiwyg
)
)
)
[location] => Array
(
[0] => Array
(
[0] => Array
(
[param] => page_template
[operator] => ==
[value] => page-templates/faq.php
)
)
)
)
Warning: Illegal string offset ‘type’ in /home/ubuntu/workspace/wp-content/plugins/advanced-custom-fields-pro/pro/acf-pro.php on line 287
Warning: Illegal string offset ‘type’ in /home/ubuntu/workspace/wp-content/plugins/advanced-custom-fields-pro/pro/acf-pro.php on line 316
Warning: array_shift() expects parameter 1 to be array, string given in /home/ubuntu/workspace/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php on line 1747
Hi @avi-fatal
Could you please check this page to learn more about registering custom fields via PHP: https://www.advancedcustomfields.com/resources/register-fields-via-php/?
Also, you can always create the field groups from backend and then export it to PHP code from “Custom Fields > Tools” (PRO version) or “Custom Fields > Export” (free version).
Thanks 🙂
You must be logged in to reply to this topic.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.