Could someone explain me with a little example how create a button that creates a new custom field dynamically?

I'm working on a plugin and using add_meta_box, I need an input box (administration-side) and a button that when clicked will create a new input box, after saving the previous data (on a custom database).

  • Are you looking for something like this - web-design-talk.co.uk/examples/2/1 You want to add many values under one custom field just like that example ? – amit Jul 11 '12 at 15:29
  • yes! Exactly! Could you help me with a simple example of this in case of a form in a post-new.php ? How do this with a plugin ? – Francesco Jul 13 '12 at 9:04

You are looking for Repeatable Fields.

Here in WPSE, it was covered in the following Q&A:
Custom Meta Boxes: Store two values in one repeatable field

A Gist:

Class helpers for building the plugin options page:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.