Title: Custom Metabox with Repeatable Fields
Last modified: February 2, 2021

---

# Custom Metabox with Repeatable Fields

 *  Resolved [tmarnell](https://wordpress.org/support/users/tmarnell/)
 * (@tmarnell)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-metabox-with-repeatable-fields/)
 * My organization is using categories in Connections to track active group memberships.
   We need a repeatable field group in our custom metabox to record membership in
   previous years for reporting, like:
 * 1) Category (Select)
    2) Start Date (Datepicker) 3) End Date (Datepicker)
 * In the metabox API class, I see a case for ‘repeatable’ in the switch for field
   type, but when I attempt to create a repeatable field with subfields, WordPress
   prints out the error “Warning: Invalid argument supplied for foreach() in class.
   metabox-api.php on line 845”.
 * How can I set up the metabox to have a repeatable set of fields like this?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-metabox-with-repeatable-fields/#post-13999277)
 * The repeatable fields option in the Metabox API is not complete and has not had
   work on it in years due to the lack of interest or need. It’s basically just 
   a skeleton that is probably best removed.
 * You can still accomplish what you want. I suggest using the Open Hours addon 
   as an example. It has repeatable fields for each day of the week.
    - [https://wordpress.org/plugins/connections-business-directory-hours/](https://wordpress.org/plugins/connections-business-directory-hours/)
 * I hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘Custom Metabox with Repeatable Fields’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/connections_2b7e99.svg)
 * [Connections Business Directory](https://wordpress.org/plugins/connections/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/connections/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/connections/)
 * [Active Topics](https://wordpress.org/support/plugin/connections/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/connections/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/connections/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/custom-metabox-with-repeatable-fields/#post-13999277)
 * Status: resolved