diff --git a/wp-includes/post.php b/wp-includes/post.php index 2f7cba613f..993056ff2c 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -8094,10 +8094,11 @@ function get_available_post_mime_types( $type = 'attachment' ) { $mime_types = apply_filters( 'pre_get_available_post_mime_types', null, $type ); if ( ! is_array( $mime_types ) ) { - $mime_types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type ) ); + $mime_types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s AND post_mime_type != ''", $type ) ); } - return $mime_types; + // Remove nulls from returned $mime_types. + return array_values( array_filter( $mime_types ) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 45917072ae..cbf661fdf0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-beta2-58436'; +$wp_version = '6.6-beta2-58437'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.