Skip Navigation

[Résolu] Set defaults for repeated fields

This support ticket is created Il y a 7 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Christian Cox Il y a 7 années et 1 mois.

Assisté par: Christian Cox.

Auteur
Publications
#587222

For our tour business we have included items and excluded items - I have these working and displaying for events - that is great - I have a simple text field that is repeatable for each of these lists - the lists for a 'new event' start blank

But what I want to do is to have the list of repeated items for these two categories populated with some default items from the start - these defaults may be overwritten or removed - but this is a starting point for any new event

For example - let's consider excluded items - most of our events have 'flights', 'visas', 'alcoholic drink's and 'any other activities not specifically mentioned on the itinerary' but some do not - say they are based in the UK - our home country - so do not need the flight and visas element - but I would like to have excluded items prepopulated with 'flights', 'visas', 'alcoholic drink's and 'any other activities not specifically mentioned on the itinerary' - the admin could then remove items that are not applicable - or add new items to this list

Included items is a similar scenario - but with different lists of items

#587311

Hi, it's not currently possible to define multiple default values for a repeating field in a new post, unfortunately. The only way I can think of to accomplish this in wp-admin is to create a new post that includes the options you want as defaults, and save it as a Draft. Then use the "Duplicate" function from the post list screen to create a clone of this template any time you want to create a new Post.

#587318

Ah pants - possible in the new version of repeated fields by any chance?

#587327

As I understand it, no. Even with a group of repeating fields in the new system, a single field in that group can only be predefined with a single default value. You must manually add that first repeating field group to a new post...it won't be created automatically for you. So I'm afraid the upcoming release won't solve this problem for you - it won't be possible to preselect these options in wp-admin effectively.