Ok, definitely I am a “newbie” here and just stumbled upon this:
I have a custom taxonomy for my custom post type. I have removed the default metabox and have created an ACF taxonomy field instead.
Initially I had all 3 options: Create Terms, Save Terms and Load Terms enabled.
Later I disabled them all.
Now I have my posts objects saved in the fashion with all the Terms settings disabled.
I am trying to add a tax_query – in the admin list of my post type and it isn’t working.
After all kind of adjustments in my tax_query and custom taxonomy code, I finally checked my database and realized that I have no records saved in the taxonomy tables.
Data have been only saved in the postmeta table.
So, I guess those “xxxx Terms” settings found in the taxonomy field options are involved.
I searched for the documentation, but frankly I am not 100% clear about what Save Terms and Load Terms are doing.
I would assume Save Terms would save in the terms/taxonomy for the post, so I could tax_query later on, but yet this is a guess.
Furthermore I have no clue at all about the Load Terms – I am not getting the Load value from posts terms explanation as well.
Could someone give me an explanation for those options?
These settings cause the taxonomy field to work the same way as the default taxonomy metabox that you removed. It updates the relationships of posts to terms
Create Terms: Let’s users create new terms
These are the ones that will give you problems
Load Terms: Gets existing terms the post is associated with
Save Terms: Saves the terms for the post
With these off the only place these terms are associated are in the acf field and you must to a meta_query to get posts in a specific term
With these turned on the value are stored in a way that will let you create wordpress term templates “taxonomy-{$taxonomy_name}.php” and use a tax_query for getting posts in a term.
@hube2 John, thanks a lot for the response and the help.
I realized that as with Save Terms disabled – my tax_query was returning nothing.
I enabled, re-saved the post and now tax_query works.
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw
— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.