Changeset 12110
- Timestamp:
- 10/26/2009 05:56:28 PM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r12098 r12110 1106 1106 */ 1107 1107 function get_media_item( $attachment_id, $args = null ) { 1108 global $ post_mime_types, $redir_tab;1108 global $redir_tab; 1109 1109 1110 1110 if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) ) … … 1131 1131 } 1132 1132 1133 $type = ''; 1134 if ( isset($post_mime_types) ) { 1135 $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); 1136 $type = array_shift($keys); 1137 $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; 1138 } 1133 $post_mime_types = get_post_mime_types(); 1134 $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); 1135 $type = array_shift($keys); 1136 $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; 1139 1137 1140 1138 $form_fields = get_attachment_fields_to_edit($post, $errors); -
trunk/wp-admin/includes/post.php
r12069 r12110 838 838 839 839 /** 840 * Get default post mime types 841 * 842 * @since 2.9.0 843 * 844 * @return array 845 */ 846 function get_post_mime_types() { 847 $post_mime_types = array( // array( adj, noun ) 848 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')), 849 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')), 850 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')), 851 ); 852 853 return apply_filters('post_mime_types', $post_mime_types); 854 } 855 856 /** 840 857 * {@internal Missing Short Description}} 841 858 * … … 872 889 $media_per_page = 20; 873 890 $q['posts_per_page'] = $media_per_page; 874 $post_mime_types = array( // array( adj, noun ) 875 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')), 876 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')), 877 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')), 878 ); 879 $post_mime_types = apply_filters('post_mime_types', $post_mime_types); 880 891 892 $post_mime_types = get_post_mime_types(); 881 893 $avail_post_mime_types = get_available_post_mime_types('attachment'); 882 894 -
trunk/wp-admin/upload.php
r11979 r12110 147 147 } 148 148 149 $post_mime_types = array( 150 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')), 151 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')), 152 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')), 153 ); 154 $post_mime_types = apply_filters('post_mime_types', $post_mime_types); 155 149 $post_mime_types = get_post_mime_types(); 156 150 $avail_post_mime_types = get_available_post_mime_types('attachment'); 157 151
Note: See TracChangeset
for help on using the changeset viewer.