This topic contains 2 replies, has 2 voices, and was last updated by  devr52 2 months, 4 weeks ago.

  • Author
  • #9389


    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.

  • #9390


    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_type as the field, because that is the taxonomy we want to save against.

    I also updated the docs to explain this:

  • #9396


    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.