Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (3 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/twentyten/loop-attachment.php

    r45932 r47122  
    106106            }
    107107
    108             // If there is more than 1 image attachment in a gallery
     108            // If there is more than 1 image attachment in a gallery...
    109109            if ( count( $attachments ) > 1 ) {
    110110                $k++;
    111111                if ( isset( $attachments[ $k ] ) ) {
    112                     // get the URL of the next image attachment
     112                    // ...get the URL of the next image attachment.
    113113                    $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
    114                 } else {          // or get the URL of the first image attachment
     114                } else {
     115                    // ...or get the URL of the first image attachment.
    115116                    $next_attachment_url = get_attachment_link( $attachments[0]->ID );
    116117                }
    117118            } else {
    118                 // or, if there's only 1 image attachment, get the URL of the image
     119                // Or, if there's only 1 image attachment, get the URL of the image.
    119120                $next_attachment_url = wp_get_attachment_url();
    120121            }
    121122            ?>
    122123                        <p class="attachment"><a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
    123                                                                     <?php
    124                                                                     /**
    125                                                                      * Filter the Twenty Ten default attachment width.
    126                                                                      *
    127                                                                      * @since Twenty Ten 1.0
    128                                                                      *
    129                                                                      * @param int The default attachment width in pixels. Default 900.
    130                                                                      */
    131                                                                     $attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
    132                                                                     /**
    133                                                                      * Filter the Twenty Ten default attachment height.
    134                                                                      *
    135                                                                      * @since Twenty Ten 1.0
    136                                                                      *
    137                                                                      * @param int The default attachment height in pixels. Default 900.
    138                                                                      */
    139                                                                     $attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
    140                                                                     echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
    141                                                                     ?>
     124                            <?php
     125                            /**
     126                             * Filter the Twenty Ten default attachment width.
     127                             *
     128                             * @since Twenty Ten 1.0
     129                             *
     130                             * @param int The default attachment width in pixels. Default 900.
     131                             */
     132                            $attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
     133                            /**
     134                             * Filter the Twenty Ten default attachment height.
     135                             *
     136                             * @since Twenty Ten 1.0
     137                             *
     138                             * @param int The default attachment height in pixels. Default 900.
     139                             */
     140                            $attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
     141                            // Filterable image width with, essentially, no limit for image height.
     142                            echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) );
     143                            ?>
    142144                            </a></p>
    143145
     
    178180
    179181<?php endwhile;
    180 }; // end of the loop. ?>
     182}; // End of the loop. ?>
Note: See TracChangeset for help on using the changeset viewer.