get_attached_media WordPress Filter Hook

The get_attached_media hook allows you to retrieve all the media attachments for a given post. This can be useful for displaying a gallery of images or videos attached to a post.

apply_filters( 'get_attached_media', WP_Post[] $children, string $type, WP_Post $post ) #

Filters the list of media attached to the given post.


Parameters

$children

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

$type

(string)Mime type of the media desired.

$post

(WP_Post)Post object.


Top ↑

Source

File: wp-includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More