How to update the title of audio file through its attachment metadata
I am trying to programmatically update some metadata of audio file attached to a post. I have been able to update the artist and album properties of the audio file but title doesn't stick. I can go through media library and edit the title and it works but not through backend. Can you please assist? Here's how I do so now:
$meta = wp_get_attachment_metadata( $attachment-ID, false);
$meta = array (
'artist' = $mainArtist,
'title' = $TitleAndFeaturedArtist,
'album' = ' ',
);
wp_update_attachment_metadata( $attachment-ID, $meta);
The artist and album gets updated but not title. Title seems to be coming from the iD3 tag but through media library in wordpress, you can edit and set yours. I am trying to avoid manually processing over 2000 files. There has to be a way :(
Please help. Any suggestions or alternative would help
Topic audio post-meta attachments Wordpress
Category Web