WordPress.org

Make WordPress Core

Ticket #43658: 43658.patch

File 43658.patch, 1.3 KB (added by itzmekhokan, 18 months ago)
  • src/wp-includes/media.php

     
    35673567        foreach ( $months as $month_year ) {
    35683568                $month_year->text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month_year->month ), $month_year->year );
    35693569        }
    3570 
     3570        /* settings 'mimeTypes' filter by available post mime types which is already done in media 'list' mode */
     3571        $avail_post_mime_types = get_available_post_mime_types( 'attachment' );
     3572        $mimeTypes = wp_list_pluck( get_post_mime_types(), 0 );
     3573        foreach ( $mimeTypes as $mime_type => $label ) {
     3574                    if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {
     3575                        unset($mimeTypes[$mime_type]);
     3576                    }
     3577        }
    35713578        $settings = array(
    35723579                'tabs'             => $tabs,
    35733580                'tabUrl'           => add_query_arg( array( 'chromeless' => true ), admin_url( 'media-upload.php' ) ),
    3574                 'mimeTypes'        => wp_list_pluck( get_post_mime_types(), 0 ),
     3581                'mimeTypes'        => $mimeTypes,
    35753582                /** This filter is documented in wp-admin/includes/media.php */
    35763583                'captions'         => ! apply_filters( 'disable_captions', '' ),
    35773584                'nonce'            => array(