Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: twentytwelve_attachment_size

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