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
932      if ( $text ) {
933           $link_text = esc_attr($text);
934      } elseif ( ( is_int($size) && $size != 0 ) or ( is_string($size) && $size != 'none' ) or $size != false ) {
935           $link_text = wp_get_attachment_image($id, $size, $icon);
936      }
937
938      if( trim($link_text) == '' )
939           $link_text = $_post->post_title;
940
941      return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
942 }
943
944 /**
945  * Retrieve HTML content of attachment image with link.
946  *
947  * @since 2.0.0
948  * @deprecated Use {@link wp_get_attachment_link()}
949  * @see wp_get_attachment_link() Use instead.
950  *