Hi all,
I have an ACF taxonomy field attached to media items. I’d like to be able to dynamically populate the core title/caption/description fields for media items based on the values in that taxonomy field (and potentially some other custom fields).
I can do this quite readily using the edit_attachment
hook which is fired when I manually update a media item. I’d like to do this on the fly with the media modal too. After much digging I’ve found the wp_ajax_save-attachment-compat
hook, but this seems to only fire when registering native custom fields for media — not ACF fields.
Given custom fields attached to media items are AJAX-saved in the media modal I’m hoping there might be something I can hook into or build upon. Any suggestions?
Cheers,
Andy