Tagged: ,

Viewing 2 reply threads
  • Author
    Posts
    • #7802

      Hi, I searched the demos and forums but couldn’t quite find what I’m looking for.

      I want to repeat a meta box with an “add more”

      Say I have a meta box called “Event” that has name, date, description as piklist fields.

      Then I want to allow the user to repeat this meta box with an “add more” and create a new event with the same fields.

      I know this is possible with ACF but I’m trying to stick to piklist. Is this possible? And if so, how?

    • #7806
      ccarey75
      Participant

      I’ve only started playing with it so there may be other ways, but you can create a grouped field and repeat that, which is much the same as the way ACF does things

      
      piklist('field', array(
          'type' 			=> 'group'
          ,'label' 			=> 'Event'
          ,'add_more' 		=> true
          ,'fields' 			=> array(
      	  // add the fields that describe an event
                array(
                   'type' 			=> 'text'
                   ,'field' 			=> 'event_name'
                   ,'label' 			=> 'Event Name'
                )
               // ... etc - more fields
          )
        ));
      
    • #7807

      Thanks. However, I don’t want to repeat fields. I want to repeat an entire metabox.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.