get_attached_media_args filter-hookWP 3.6.0

Filters arguments used to retrieve media attached to the given post.

Usage

add_filter( 'get_attached_media_args', 'wp_kama_get_attached_media_args_filter', 10, 3 );

/**
 * Function for `get_attached_media_args` filter-hook.
 * 
 * @param array   $args Post query arguments.
 * @param string  $type Mime type of the desired media.
 * @param WP_Post $post Post object.
 *
 * @return array
 */
function wp_kama_get_attached_media_args_filter( $args, $type, $post ){

	// filter...
	return $args;
}
$args(array)
Post query arguments.
$type(string)
Mime type of the desired media.
$post(WP_Post)
Post object.

Changelog

Since 3.6.0 Introduced.

Where the hook is called

get_attached_media()
get_attached_media_args
wp-includes/media.php 4679
$args = apply_filters( 'get_attached_media_args', $args, $type, $post );

Where the hook is used in WordPress

Usage not found.