Media: Revert [44947].

`get_available_post_mime_types()` uses a query that's extremely slow on sites with lots of posts. The original fix can be revisited after those performance issues are tackled.

See #43658.

Built from https://develop.svn.wordpress.org/trunk@45270


git-svn-id: http://core.svn.wordpress.org/trunk@45079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-04-26 00:44:52 +00:00
parent 700f891c36
commit 0bbfe42ab1
2 changed files with 2 additions and 10 deletions

View File

@ -3576,18 +3576,10 @@ function wp_enqueue_media( $args = array() ) {
$month_year->text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month_year->month ), $month_year->year );
}
// Filter to show only available mime types.
$avail_post_mime_types = get_available_post_mime_types( 'attachment' );
$mimeTypes = wp_list_pluck( get_post_mime_types(), 0 );
foreach ( $mimeTypes as $mime_type => $label ) {
if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {
unset( $mimeTypes[ $mime_type ] );
}
}
$settings = array(
'tabs' => $tabs,
'tabUrl' => add_query_arg( array( 'chromeless' => true ), admin_url( 'media-upload.php' ) ),
'mimeTypes' => $mimeTypes,
'mimeTypes' => wp_list_pluck( get_post_mime_types(), 0 ),
/** This filter is documented in wp-admin/includes/media.php */
'captions' => ! apply_filters( 'disable_captions', '' ),
'nonce' => array(

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-beta3-45269';
$wp_version = '5.2-beta3-45270';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.