WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/26/2009 05:56:28 PM (9 years ago)
Author:
markjaquith
Message:

Consolidate post_mime_type code. props scribu. fixes #10992

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r12069 r12110  
    838838
    839839/**
     840 * Get default post mime types
     841 *
     842 * @since 2.9.0
     843 *
     844 * @return array
     845 */
     846function 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/**
    840857 * {@internal Missing Short Description}}
    841858 *
     
    872889        $media_per_page = 20;
    873890    $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();
    881893    $avail_post_mime_types = get_available_post_mime_types('attachment');
    882894
Note: See TracChangeset for help on using the changeset viewer.