Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

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