I’m creating a database of addresses using the location addon inside a custom post type. The post title is not relevant to this custom post type, so it has been disabled. I would, however, like to be able to show the most recent location in the various areas that WP would normally show a post title without having to re-code portions of the admin (or addons such as the relationship module which defaults to showing post title in results). Thus I’m attempting to push the address from the ACF location addon to the post title on post save/update.
The code I’ve created so far only works on post update because there are existing values in the DB for ACF fields, but for this reason it’s of course pushing old data to the post title: