Add a generic `get_attached_media()` function and use it in get_attached_audio|video|images. Add filters for the query args and resulting array. fixes #23843.


git-svn-id: http://core.svn.wordpress.org/trunk@23776 1a063a9b-81f0-0310-95a4-ce76da25c4cd