Home › Forums › Backend Issues (wp-admin) › [acf/select] missing default value if "stylised UI" is enabled › Reply To: [acf/select] missing default value if "stylised UI" is enabled
@mmjaeger, your problem is that get_the_ID()
only works inside the WP loop.
try
global $post;
if ( has_term( $term->slug, 'resource_category', $post->ID ) )
however, adding a default value to a post that already has a selected category really should not have any effect, since something is already selected, unless I’m missing something, and if it’s a new post there won’t be anything selected so there will be no default value. Like I said, maybe I’m missing it and just not understanding.
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.