Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_get_attachment_link

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
1198           $link_text = $text;
1199      elseif ( $size && 'none' != $size )
1200           $link_text = wp_get_attachment_image( $id, $size, $icon );
1201      else
1202           $link_text = '';
1203
1204      if ( trim( $link_text ) == '' )
1205           $link_text = $_post->post_title;
1206
1207      return apply_filters( 'wp_get_attachment_link', "<a href='$url'>$link_text</a>", $id, $size, $permalink, $icon, $text );
1208 }
1209
1210 /**
1211  * Wrap attachment in <<p>> element before content.
1212  *
1213  * @since 2.0.0
1214  * @uses apply_filters() Calls 'prepend_attachment' hook on HTML content.
1215  *
1216  * @param string $content