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
1185           $link_text = $text;
1186      elseif ( $size && 'none' != $size )
1187           $link_text = wp_get_attachment_image( $id, $size, $icon );
1188      else
1189           $link_text = '';
1190
1191      if ( trim( $link_text ) == '' )
1192           $link_text = $_post->post_title;
1193
1194      return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
1195 }
1196
1197 /**
1198  * Wrap attachment in <<p>> element before content.
1199  *
1200  * @since 2.0.0
1201  * @uses apply_filters() Calls 'prepend_attachment' hook on HTML content.
1202  *
1203  * @param string $content