Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: post_mime_types

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
862      $media_per_page = get_user_option('upload_per_page');
863      if ( empty($media_per_page) )
864           $media_per_page = 20;
865      $q['posts_per_page'] = $media_per_page;
866      $post_mime_types = array(     //     array( adj, noun )
867                     'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
868                     'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
869                     'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
870                );
871      $post_mime_types = apply_filters('post_mime_types', $post_mime_types);
872
873      $avail_post_mime_types = get_available_post_mime_types('attachment');
874
875      if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) )
876           unset($q['post_mime_type']);
877
878      wp($q);
879
880      return array($post_mime_types, $avail_post_mime_types);