get_attached_media
get_attached_media ( $type, $post = 0 )
Parameters:- (string) type Mime type.
- (int|WP_Post) post Optional. Post ID or WP_Post object. Default is global $post.
Returns:- (WP_Post[]) Array of media attached to the given post.
Defined at: - Introduced in WordPress: 3.6.0
- Deprecated in WordPress: —
Description
Retrieves media attached to the passed post.