May 23, 2019 at 3:40 pm #9389devr52Participant
When creating a piklist field for a custom taxonomy on a cpt,
I can set
'scope' => 'post_meta'and provide a field name, and it will save the
id of the taxonomy term chosen to that custom meta field with the provided name.
This of course is not the same as using the built-in WP terms table, which allows the taxonomy to be edited in the admin page for the cpt normally.
To correct this, I change the scope of the piklist field to
"taxonomy". Now it saves to the WP terms table, and the built-in WP mechanisms also work. However, what happens to
'field'? If I remove it, it no longer works, but what is it doing with it?
When the field is set as required and nothing is chosen, it doubles up the error message saying:
* <Label> is a required field
* <field name value> is a required field
This is ugly and broken.
May 23, 2019 at 9:16 pm #9390SteveKeymaster
This is not broken. You just didn’t take the time to go through the code.
If you take a look in the Piklist Demos you would see that the when the scope is set to
taxonomy, we use
piklist_demo_typeas the field, because that is the taxonomy we want to save against.
I also updated the docs to explain this:
May 28, 2019 at 1:30 pm #9396devr52Participant
That is what my field is set to–the taxonomy type.
It still doubles up the error message, so that is still an issue–any ideas?
- You must be logged in to reply to this topic.