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.
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!
© 2022 Advanced Custom Fields.