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 |
|---|---|
| 66 | else |
| 67 | // or get the URL of the first image attachment |
| 68 | $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
| 69 | } else { |
| 70 | // or, if there's only 1 image, get the URL of the image |
| 71 | $next_attachment_url = wp_get_attachment_url(); |
| 72 | } |
| 73 | ?> |
| 74 | <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php |
| 75 | $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 ); |
| 76 | echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height. |
| 77 | ?></a> |
| 78 | |
| 79 | <?php if ( ! empty( $post->post_excerpt ) ) : ?> |
| 80 | <div class="entry-caption"> |
| 81 | <?php the_excerpt(); ?> |
| 82 | </div> |
| 83 | <?php endif; ?> |
| 84 | </div><!-- .attachment --> |