Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (7 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/twentytwelve/image.php

    r45932 r47122  
    7474                                        break;
    7575                                }
    76 endforeach;
     76                        endforeach;
    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 );
    8484                                else :
    85                                         // or get the URL of the first image attachment
     85                                        // ...or get the URL of the first image attachment.
    8686                                        $next_attachment_url = get_attachment_link( $attachments[0]->ID );
    8787                                endif;
    88 else :
    89         // or, if there's only 1 image, get the URL of the image
    90         $next_attachment_url = wp_get_attachment_url();
    91 endif;
    92 ?>
     88                        else :
     89                                // Or, if there's only 1 image, get the URL of the image.
     90                                $next_attachment_url = wp_get_attachment_url();
     91                        endif;
     92                        ?>
    9393                                                                <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
    94                                                                                                         <?php
    95                                                                                                         /**
    96                                                                                                         * Filter the image attachment size to use.
    97                                                                                                         *
    98                                                                                                         * @since Twenty Twelve 1.0
    99                                                                                                         *
    100                                                                                                         * @param array $size {
    101                                                                                                         *     @type int The attachment height in pixels.
    102                                                                                                         *     @type int The attachment width in pixels.
    103                                                                                                         * }
    104                                                                                                         */
    105                                                                                                         $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
    106                                                                                                         echo wp_get_attachment_image( $post->ID, $attachment_size );
    107                                                                                                         ?>
     94                                                                        <?php
     95                                                                        /**
     96                                                                        * Filter the image attachment size to use.
     97                                                                        *
     98                                                                        * @since Twenty Twelve 1.0
     99                                                                        *
     100                                                                        * @param array $size {
     101                                                                        *     @type int The attachment height in pixels.
     102                                                                        *     @type int The attachment width in pixels.
     103                                                                        * }
     104                                                                        */
     105                                                                        $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
     106                                                                        echo wp_get_attachment_image( $post->ID, $attachment_size );
     107                                                                        ?>
    108108                                                                </a>
    109109
    … …  
    135135                                <?php comments_template(); ?>
    136136
    137                         <?php endwhile; // end of the loop. ?>
     137                        <?php endwhile; // End of the loop. ?>
    138138
    139139                </div><!-- #content -->
Note: See TracChangeset for help on using the changeset viewer.