Changeset 57687 for trunk/src/wp-includes/media.php
- Timestamp:
- 02/21/2024 07:25:18 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r57597 r57687 973 973 974 974 if ( $icon ) { 975 $src = wp_mime_type_icon( $attachment_id );975 $src = wp_mime_type_icon( $attachment_id, '.svg' ); 976 976 977 977 if ( $src ) { … … 979 979 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 980 980 981 $src_file 981 $src_file = $icon_dir . '/' . wp_basename( $src ); 982 982 list( $width, $height ) = wp_getimagesize( $src_file ); 983 $ext = strtolower( substr( $src_file, -4 ) ); 984 if ( '.svg' === $ext ) { 985 // SVG does not have true dimensions, so this assigns width and height directly. 986 $width = 48; 987 $height = 64; 988 } else { 989 list( $width, $height ) = wp_getimagesize( $src_file ); 990 } 983 991 } 984 992 } … … 3068 3076 $track['thumb'] = compact( 'src', 'width', 'height' ); 3069 3077 } else { 3070 $src = wp_mime_type_icon( $attachment->ID );3078 $src = wp_mime_type_icon( $attachment->ID, '.svg' ); 3071 3079 $width = 48; 3072 3080 $height = 64; … … 4340 4348 'type' => $type, 4341 4349 'subtype' => $subtype, 4342 'icon' => wp_mime_type_icon( $attachment->ID ),4350 'icon' => wp_mime_type_icon( $attachment->ID, '.svg' ), 4343 4351 'dateFormatted' => mysql2date( __( 'F j, Y' ), $attachment->post_date ), 4344 4352 'nonces' => array( … … 4511 4519 $response['thumb'] = compact( 'src', 'width', 'height' ); 4512 4520 } else { 4513 $src = wp_mime_type_icon( $attachment->ID );4521 $src = wp_mime_type_icon( $attachment->ID, '.svg' ); 4514 4522 $width = 48; 4515 4523 $height = 64;
Note: See TracChangeset
for help on using the changeset viewer.