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
1934      } elseif ( wp_attachment_is_image( $post->ID ) ) {
1935           // We have an image without a thumbnail
1936
1937           $src = wp_get_attachment_url( $post->ID );
1938           $src_file = & $file;
1939           $class = 'attachmentimage';
1940      } elseif ( $src = wp_mime_type_icon( $post->ID ) ) {
1941           // No thumb, no image. We'll look for a mime-related icon instead.
1942
1943           $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
1944           $src_file = $icon_dir . '/' . basename($src);
1945      }
1946
1947      if ( !isset($src) || !$src )
1948           return false;
1949
1950      return array($src, $src_file);
1951 }
1952