Media: Dynamically generate attachment filters using get_post_mime_types().

Moves `get_post_mime_types()` from `wp-admin/includes/post.php` to `wp-includes/post.php`.

fixes #22514, see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22743 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-11-21 10:18:59 +00:00
parent 79435f42fa
commit 8e6aa60fa4
5 changed files with 81 additions and 63 deletions
+7 -12
View File
@@ -1322,10 +1322,9 @@ function wp_enqueue_media( $args = array() ) {
unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );
$settings = array(
'tabs' => $tabs,
'tabUrl' => add_query_arg( array(
'chromeless' => true
), admin_url('media-upload.php') ),
'tabs' => $tabs,
'tabUrl' => add_query_arg( array( 'chromeless' => true ), admin_url('media-upload.php') ),
'mimeTypes' => wp_list_pluck( get_post_mime_types(), 0 ),
);
$post = null;
@@ -1354,16 +1353,12 @@ function wp_enqueue_media( $args = array() ) {
'uploadMoreFiles' => __( 'Upload more files' ),
// Library
'mediaLibraryTitle' => __( 'Media Library' ),
'createNewGallery' => __( 'Create a new gallery' ),
'insertIntoPost' => $hier ? __( 'Insert into page' ) : __( 'Insert into post' ),
'returnToLibrary' => __( '← Return to library' ),
'mediaLibraryTitle' => __( 'Media Library' ),
'createNewGallery' => __( 'Create a new gallery' ),
'returnToLibrary' => __( '← Return to library' ),
'allMediaItems' => __( 'All media items' ),
'insertIntoPost' => $hier ? __( 'Insert into page' ) : __( 'Insert into post' ),
'uploadedToThisPost' => $hier ? __( 'Uploaded to this page' ) : __( 'Uploaded to this post' ),
'images' => __( 'Images' ),
'audio' => __( 'Audio' ),
'videos' => __( 'Videos' ),
// Embed
'embedFromUrlTitle' => __( 'Embed From URL' ),