![]() |
I want to be able to create sub fields inside a flexible content field.
My setting is this one:
menu_item_field is a flexible content field that contains:
1.1 menu_item_parent (text)
1.2 menu_item_child (repeater field)
1.2.1 menu_item_child_title (text)
1.2.2 menu_item_child_text (text)
1.2.3 menu_item_child_img (repeater field)
1.2.3.1 menu_item_child_img_item (img)
This is the structure that results of the above setting:
Group One
Item 1 title
Item 1 description
Item 1 img 1
Item 1 img 2
Item 2 title
Item 2 description
Item 1 img 1
Item 1 img 2
So far I've been able to insert only the Group field and I wanted to know if it's possible to do more complex stuff.
I did it using:
The above code returned only the main group titles ie: I know there's but I haven't been able to successfully use it. My main goal is to be able to edit or create new fields using a custom UI in the frontend through AJAX. I prefer this instead of acf_form(). So, my question, is it possible to achieve what I need and what would be the proper function with the above settings. Thanks. Solution - 1can you please share URL of your site? Solution - 2Hi there, Try this
Next one is difficult, i didn't get proper solution for this. But the following solution works The above solution will only work when you add items first time. update_field() and update_sub_field() canuse to update existing fields. Try print_r(get_field('menu_item_field')); You will get more details about how the data arranged in backend. Please let me know if you need any more help. Kind regards, Hariprasad Solution - 3Have you tried using the actual field name? 'acf_fc_layout' => 'layout_1', 'field_5eb8743702e68' => 'test1', 'field_5eb8748302e69' => 'test2', |
Wordpress |
Type: | Code Example |
Category: | Coding |
Sub Category: | Code Example |
Uploaded by: | Admin |
Views: | 25 |