I am trying to get value of each clone (adding by +) field value and want to repeat video embed code.
First I am using this wordpress meta box plugin.
http://www.deluxeblogtips.com/2010/04/how-to-create-meta-box-wordpress-post.html
I have a CPT where I want to use one code that will display as per the number of fields. There is a text meta box on CPT where user can add more by clicking on + button means clone. So for each field user will enter different value of image ID. So I want to repeat my code as per the number of field.
So if user adds 3 field it will repeat the code 3 times. which have something this structure.
<div>
<a href=""><img src="first-field-value" /></a>
</div>
So I want to repeat this structure as per how many field user created and entered the value for that.
I am really sorry if I unable to describe properly. But please let me know if you want to know something more than this.
The Wp Alchemy class at http://farinspace.com/wpalchemy-metabox/ allows for repeating fields.
If you are rolling your own, you need to make sure that the form fields that represent your data entry are named with a trailing ‘[]’, eg; myfieldname[]. This ensures that php treats the values for each cloned item as an array.