WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 1169 | $link_text = $text; |
| 1170 | elseif ( $size && 'none' != $size ) |
| 1171 | $link_text = wp_get_attachment_image( $id, $size, $icon ); |
| 1172 | else |
| 1173 | $link_text = ''; |
| 1174 | |
| 1175 | if ( trim( $link_text ) == '' ) |
| 1176 | $link_text = $_post->post_title; |
| 1177 | |
| 1178 | return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text ); |
| 1179 | } |
| 1180 | |
| 1181 | /** |
| 1182 | * Wrap attachment in <<p>> element before content. |
| 1183 | * |
| 1184 | * @since 2.0.0 |
| 1185 | * @uses apply_filters() Calls 'prepend_attachment' hook on HTML content. |
| 1186 | * |
| 1187 | * @param string $content |