I have post in WP. This post has attached image as attachment. I set description of this image via dialog (gallery tab) in post edit section.
Now I need WP functions to programmatically get all metadata for this attachment (description,title,caption,…) and another function to set the same data.
What functions to use ?
use get_children() to retrive atachement for posts.
a full example here Get URLs, Captions & Titles for Images Attached to Posts in WordPress
This works for me:
The order of the array is allocated as follows.