get_attached_media

SummerySummery

Retrieves media attached to the passed post.

Syntax

get_attached_media( string $type, int|WP_Post $post )

ParametersParameters

$type

(string) (Required) Mime type.

$post

(int|WP_Post) (Optional) Post ID or WP_Post object. Default is global $post.

ReturnReturn

(WP_Post[]) Array of media attached to the given post.

SourceSource

File: wp-includes/media.php


			

ChangelogChangelog

Changelog
Version Description
3.6.0 Introduced.
Scroll to Top