Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/image.php

    r45932 r47122  
    7676                }
    7777
    78                 // If there is more than 1 attachment in a gallery
     78                // If there is more than 1 attachment in a gallery...
    7979                if ( count( $attachments ) > 1 ) {
    8080                    $k++;
    8181                    if ( isset( $attachments[ $k ] ) ) {
    82                         // get the URL of the next image attachment
     82                        // ...get the URL of the next image attachment.
    8383                        $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
    84                     } else {      // or get the URL of the first image attachment
     84                    } else {
     85                        // ...or get the URL of the first image attachment.
    8586                        $next_attachment_url = get_attachment_link( $attachments[0]->ID );
    8687                    }
    8788                } else {
    88                     // or, if there's only 1 image, get the URL of the image
     89                    // Or, if there's only 1 image, get the URL of the image.
    8990                    $next_attachment_url = wp_get_attachment_url();
    9091                }
    9192                ?>
    9293                                    <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
    93                                                         <?php
    94                                                         /**
    95                                                          * Filter the Twenty Eleven default attachment size.
    96                                                          *
    97                                                          * @since Twenty Eleven 1.0
    98                                                          *
    99                                                          * @param int The height and width attachment size dimensions in pixels. Default 848.
    100                                                          */
    101                                                         $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 );
    102                                                         echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
    103                                                         ?>
     94                                        <?php
     95                                        /**
     96                                         * Filter the Twenty Eleven default attachment size.
     97                                         *
     98                                         * @since Twenty Eleven 1.0
     99                                         *
     100                                         * @param int The height and width attachment size dimensions in pixels. Default 848.
     101                                         */
     102                                        $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 );
     103                                        // Filterable image width with 1024px limit for image height.
     104                                        echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) );
     105                                        ?>
    104106                                    </a>
    105107
     
    131133                    <?php comments_template(); ?>
    132134
    133                 <?php endwhile; // end of the loop. ?>
     135                <?php endwhile; // End of the loop. ?>
    134136
    135137            </div><!-- #content -->
Note: See TracChangeset for help on using the changeset viewer.