Home › Forums › General Issues › Custom Post Type, Custom Taxonomy CF7 Form — Taxonomy not saved
Hiho,
I built a custom post type with two taxonomies (“umsaetze” and “sortimente”). Both by plugin (my own plugin, I mean, instead of by theme). Both taxonomies are set in the post type args:
‘taxonomies’ => array( ‘sortimente’, ‘umsaetze’ ),
And the registration of the taxonomies look like this:
register_taxonomy(‘sortimente’,array(‘phy_shop_offers’), array(
‘hierarchical’ => true,
‘labels’ => $labels,
‘show_ui’ => true,
‘show_in_rest’ => true,
‘show_admin_column’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘sortiment’ ),
));`
It’s my first plugin, so I hope this is correct.
Now:
I want users to submit their data through a cf7 form and wordpress to create posts of the custom post type when the form is submitted.
So far everything works like a charm! Everything is stored in the right custom field and I am happy, BUT ONLY:
I can’t get the data of the two fields “sortimente” and “umsaetze” to fill into the taxonomies. If I map the data to “normal” text custom fields, the data is saved. If I map the two cf7 fields to the two custom taxonomy fields, nothing is saved, the taxonomy stays empty.
In the field set I activated “Begriffe erstellen” (create terms?), “Begriffe speichern” (safe terms), “Begriffe laden” (load terms) for the taxonomy fields [sorry, I see only the german labels and the strings differ a bit from what is shown at https://www.advancedcustomfields.com/resources/taxonomy/%5D
For the form I map the cf7 field to taxonomy fields.
What also irritates me is: when opening on of the created posts I see the two fields in two places: As select fields in the field set plus in the taxonomy boxes in post sidebar:
https://physalia.de/images/Screenshot_20210428_154332.png
Both are empty, the fields in the field set and the taxonomy fields in the sidebar. The content of the cf7 form is not inserted.
Where is my mistake?
Thanks a lot for your help.
Best regards
nici-
The page I need help with: https://unstraublich.de/offer/
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.