How can i catch (with get_posts) attachment file (pdf, images) from a post when i have only inserted it from media library and it isn’t upload for it?
When you upload a media from a post, the post_parent attribute is setted to the post ID you are uploading from. Not so when you simple insert a post from the library: in that case if the media was already attached to a post, its post_parent is already setted, and once a media can have … Read more