Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: icon_dir

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
486
487           // We have an image without a thumbnail
488
489           $src = $post->guid;
490           $src_file = & $file;
491           $class = 'attachmentimage';
492      } elseif (! empty($mime) ) {
493
494           // No thumb, no image. We'll look for a mime-related icon instead.
495           $icon_dir = apply_filters('icon_dir', get_template_directory().'/images');
496           $icon_dir_uri = apply_filters('icon_dir_uri', get_template_directory_uri().'/images');
497
498           $types = array(substr($mime, 0, strpos($mime, '/')), substr($mime, strpos($mime, '/') + 1), str_replace('/', '_', $mime));
499           $exts = array('jpg', 'gif', 'png');
500           foreach ($types as $type) {
501                foreach ($exts as $ext) {
502                     $src_file = "$icon_dir/$type.$ext";
503                     if ( file_exists($src_file) ) {
504                          $src = "$icon_dir_uri/$type.$ext";