[Résolu] Choose from previously created fields dont show in view filter
Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
If you use the option "choose from previously created fields" to re-use a custom field from one Field Group in another Field Group, it seems to be missing from the available fields when trying to insert a Views custom field filter.
Solution:
The field appears amongst the group of fields it has been copied to.
This support ticket is created Il y a 6 années et 11 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I am trying to: add a custom field by selecting "Choose from previously created fields" to a CPT, then use this field in a view filter. however the field is not showing in the view filter drop down list.
Link to a page where the issue can be seen: lien caché
I expected to see: the filled i added into the post fields show in the view filter drop down list
Instead, I got: only the fields that were created manually for the custom post i.e. the field that was add using "Choose from previously created fields" does not show in the list
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Hi David
I tested this locally and found that the custom field in question was missing from the original field group but appeared in the second field group, unlike your situation where it doesn't appear at all.
Can I get some further info from you to see if I can reproduce the same as you are experiencing.
You have two field groups ("Account Assumptions" and "backend settings").
What post types are each of these field groups assigned to?
The View you are creating with a filter, what post type is it for?
i tried it again and yes, you are right. the field appears in the first group where it was created but not in the second group.
each post type name is the same as the post field group (i make it like this so its easy for me to relate them.
initially i created the "backend settings" post fields group and post type. in the post fields group i had a field name: "backend assigned advisor id"
than i added this field ("backend assigned advisor id") using the "Choose from previously created fields" option in the "account assumption" post fields group
each field groups is assign to its own respective post type (only one).
the post type i want to use in the view is "account assumption".
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Hi David
Actually, what you describe sounds like the opposite of my experience, in terms of which post field group the field in question appears under when you insert a View filter.
In any case, the key question is does the field appear somewhere so that you can insert it into the filter?
The UI used to insert the filter organises the fields according to field group purely for convenience, it doesn't affect the functionality of the resulting filter, which will operate on whatever post type the View is designed to display.
If you can see the field in question under one or other field groups then you can create the filter. If you can't see the field anywhere, you can't create the filter.
I started from scratch, i.e. remove the fields from types than recreated it under backend settings post field group, then i added it using "choose from previously created fields" option to a few other post field groups that belong to different posts types.
what i noticed is that the filed is randomly show under one of the post types. so in reality it is available for some reason not under the post field group or post type it was initially created.
i was able to use the field in my view filter.
so it works, but in an awkward way. i had to go line by line to find it when i was creating the filter view....