Changeset 27869 for trunk/src/wp-admin/includes/media.php
- Timestamp:
- 03/31/2014 05:15:39 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/media.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r27864 r27869 2662 2662 <div class="wp_attachment_details edit-form-section"> 2663 2663 <p> 2664 <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong><?php 2665 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ): ?>: <?php 2666 _e( "Custom label for item in a playlist. If empty, the file's available data is used." ); 2667 endif ?></label><br /> 2664 <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br /> 2668 2665 <textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea> 2669 2666 </p> … … 2689 2686 2690 2687 <label for="content"><strong><?php _e( 'Description' ); ?></strong><?php 2691 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) : ?>: <?php2692 _e( 'Displayed on attachment pages.' );2693 endif?></label>2688 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) { 2689 echo ': ' . __( 'Displayed on attachment pages.' ); 2690 } ?></label> 2694 2691 <?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?> 2695 2692 … … 2729 2726 <div class="misc-pub-section misc-pub-filetype"> 2730 2727 <?php _e( 'File type:' ); ?> <strong><?php 2731 if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) 2728 if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) { 2732 2729 echo esc_html( strtoupper( $matches[1] ) ); 2733 else 2730 list( $mime_type ) = explode( '/', $post->post_mime_type ); 2731 if ( $mime_type !== 'image' && ! empty( $meta['mime_type'] ) ) { 2732 if ( $meta['mime_type'] !== "$mime_type/" . strtolower( $matches[1] ) ) { 2733 echo ' (' . $meta['mime_type'] . ')'; 2734 } 2735 } 2736 } else { 2734 2737 echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) ); 2738 } 2735 2739 ?></strong> 2736 2740 </div> … … 2752 2756 endif; 2753 2757 2754 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) :2758 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) { 2755 2759 2756 2760 /** … … 2762 2766 * @since 3.7.0 2763 2767 * 2764 * @param array $fields { 2765 * An array of the attachment metadata keys and labels. 2766 * 2767 * @type string $mime_type Label to be shown before the field mime_type. 2768 * @type string $year Label to be shown before the field year. 2769 * @type string $genre Label to be shown before the field genre. 2770 * @type string $length_formatted Label to be shown before the field length_formatted. 2771 * } 2768 * @param array $fields An array of the attachment metadata keys and labels. 2772 2769 */ 2773 2770 $fields = apply_filters( 'media_submitbox_misc_sections', array( 2774 'mime_type' => __( 'Mime-type:' ),2775 2771 'length_formatted' => __( 'Length:' ), 2772 'bitrate' => __( 'Bitrate:' ), 2776 2773 ) ); 2777 2774 2778 foreach ( $fields as $key => $label ): 2779 if ( ! empty( $meta[$key] ) ) : ?> 2775 foreach ( $fields as $key => $label ) { 2776 if ( empty( $meta[ $key ] ) ) { 2777 continue; 2778 } 2779 ?> 2780 2780 <div class="misc-pub-section misc-pub-mime-meta misc-pub-<?php echo sanitize_html_class( $key ); ?>"> 2781 <?php echo $label ?> <strong><?php echo esc_html( $meta[$key] ); ?></strong> 2782 </div> 2783 <?php 2784 endif; 2785 endforeach; 2786 2787 if ( ! empty( $meta['bitrate'] ) ) : ?> 2788 <div class="misc-pub-section misc-pub-bitrate"> 2789 <?php _e( 'Bitrate:' ); ?> <strong><?php 2790 echo round( $meta['bitrate'] / 1000 ), 'kb/s'; 2791 2792 if ( ! empty( $meta['bitrate_mode'] ) ) 2793 echo ' ', strtoupper( $meta['bitrate_mode'] ); 2794 2781 <?php echo $label ?> <strong><?php 2782 switch ( $key ) { 2783 case 'bitrate' : 2784 echo round( $meta['bitrate'] / 1000 ) . 'kb/s'; 2785 if ( ! empty( $meta['bitrate_mode'] ) ) { 2786 echo ' ' . strtoupper( esc_html( $meta['bitrate_mode'] ) ); 2787 } 2788 break; 2789 default: 2790 echo esc_html( $meta[ $key ] ); 2791 break; 2792 } 2795 2793 ?></strong> 2796 2794 </div> 2797 2795 <?php 2798 endif;2796 } 2799 2797 2800 2798 /** … … 2806 2804 * @since 3.7.0 2807 2805 * 2808 * @param array $fields { 2809 * An array of the attachment metadata keys and labels. 2810 * 2811 * @type string $dataformat Label to be shown before the field dataformat. 2812 * @type string $codec Label to be shown before the field codec. 2813 * } 2806 * @param array $fields An array of the attachment metadata keys and labels. 2814 2807 */ 2815 2808 $audio_fields = apply_filters( 'audio_submitbox_misc_sections', array( … … 2818 2811 ) ); 2819 2812 2820 foreach ( $audio_fields as $key => $label ): 2821 if ( ! empty( $meta['audio'][$key] ) ) : ?> 2813 foreach ( $audio_fields as $key => $label ) { 2814 if ( empty( $meta['audio'][ $key ] ) ) { 2815 continue; 2816 } 2817 ?> 2822 2818 <div class="misc-pub-section misc-pub-audio misc-pub-<?php echo sanitize_html_class( $key ); ?>"> 2823 2819 <?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][$key] ); ?></strong> 2824 2820 </div> 2825 2821 <?php 2826 endif; 2827 endforeach; 2828 2829 endif; 2822 } 2823 2824 } 2830 2825 2831 2826 if ( $media_dims ) : ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)