I’m building a quite complex custom post type structure and I would need some help regarding my metaboxes.
What I want to do:
- Thank’s to the
have_fields_and_multi()
function, the user enters data in simple text input fields (with a “Add new” button) - The values from the previous text inputs should be used to build a
select
dropdown in another metabox.
To make it simple, here is a mockup (also attached to this post): http://idzr.org/0c95
I have the first part working, it’s easy. But I can’t figure out how to make the second part to work. If I use a while($mb->have_fields_and_multi('aaa'))
in another while($mb->have_fields_and_multi('bbb'))
the page is infinite (the loop doesn’t end. If I use foreach
I have other problems.
Do you have an idea about how I can achieve this ? Thanks!!!
Ok, I finally managed to solve that by myself. It is possible thanks to :
Create the first field :
Create the second batch of fields while using
foreach
to get the data from the first fields and put that in aselect
: