I’m trying to provide an if/else statement in which if the page/post doesn’t define a value for a particular acf field, that field’s default value that is defined in the field options group is shown (which is what the get_field_object docs seem to describe) however I’m finding that its not working as desired.
If a post/page exists prior to the creation of the options group, the default value is never provided because the get_field_object queries the post_meta for the field key which doesn’t exist yet, not that actual field group’s defined field option value saved from within the field group editor (which in turn is its own custom post type).
Basically I’m trying to get away with using the field option group’s default values as the global value site wide in my templates and the individual page/post can override that but on an existing site with hundreds of posts I have to go update all existing pages/posts for the default value to be provided. For newly created pages and posts, its not an issue because the default value is retrieved via the post meta field key generated automatically.
My only way around this is a more complex query into the field group’s cusotm post type ‘acf’ and then capture the post_meta that stores the default value.
If I’m missing something fundamental please help point me in the right direction, thank you.