Ticket #25170: 25170.4.patch
File 25170.4.patch, 2.3 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/media.php
2441 2441 <div class="misc-pub-section misc-pub-filename"> 2442 2442 <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong> 2443 2443 </div> 2444 <div class="misc-pub-section misc-pub-filetype">2445 <?php _e( 'File type:' ); ?> <strong><?php2446 if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )2447 echo esc_html( strtoupper( $matches[1] ) );2448 else2449 echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );2450 ?></strong>2451 </div>2452 2444 2453 <?php 2445 <?php if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) : ?> 2446 <div class="misc-pub-section misc-pub-filetype"> 2447 <?php _e( 'File type:' ); ?> <strong><?php echo esc_html( strtoupper( $matches[1] ) ); ?></strong> 2448 </div> 2449 <?php endif; ?> 2450 2451 <?php 2452 if ( isset( $meta['filesize'] ) ) 2453 $file_size = $meta['filesize']; 2454 else 2455 $file_size = filesize( get_attached_file( $post->ID ) ); 2456 2457 if ( ! empty( $file_size ) ) : ?> 2458 <div class="misc-pub-section misc-pub-filesize"> 2459 <?php _e( 'File size:' ); ?> <strong><?php echo size_format( $file_size ); ?></strong> 2460 </div> 2461 <?php 2462 endif; 2463 2454 2464 if ( preg_match( '#^audio|video#', $post->post_mime_type ) ): 2455 2465 2456 2466 /** … … 2471 2481 * } 2472 2482 */ 2473 2483 $fields = apply_filters( 'media_submitbox_misc_sections', array( 2474 'mime_type' => __( 'Mime-type:' ),2475 2484 'year' => __( 'Year:' ), 2476 2485 'genre' => __( 'Genre:' ), 2477 2486 'length_formatted' => __( 'Length:' ), … … 2516 2525 */ 2517 2526 $audio_fields = apply_filters( 'audio_submitbox_misc_sections', array( 2518 2527 'dataformat' => __( 'Audio Format:' ), 2519 'codec' => __( 'Audio Codec:' )2520 2528 ) ); 2521 2529 2522 2530 foreach ( $audio_fields as $key => $label ): 2523 if ( ! empty( $meta['audio'][ $key] ) ) : ?>2531 if ( ! empty( $meta['audio'][ $key ] ) ) : ?> 2524 2532 <div class="misc-pub-section misc-pub-audio misc-pub-<?php echo sanitize_html_class( $key ); ?>"> 2525 <?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][ $key] ); ?></strong>2533 <?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][ $key ] ); ?></strong> 2526 2534 </div> 2527 2535 <?php 2528 2536 endif;