Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (9 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

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

    r32116 r42343  
    3333                        <?php if ( post_password_required() ) : ?>
    3434                                <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    35                         <?php else :
     35                        <?php
     36                        else :
    3637                                $images = twentyeleven_get_gallery_images();
    3738                                if ( $images ) :
    3839                                        $total_images = count( $images );
    39                                         $image = reset( $images );
     40                                        $image        = reset( $images );
    4041                        ?>
    4142                                <figure class="gallery-thumb">
    4243                                        <a href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
    43                                 </figure><!-- .gallery-thumb -->
     44        </figure><!-- .gallery-thumb -->
    4445
    45                                 <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
    46                                                 'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
    47                                                 number_format_i18n( $total_images )
    48                                         ); ?></em></p>
    49                         <?php endif; // end twentyeleven_get_gallery_images() check ?>
     46        <p><em>
     47        <?php
     48                                printf(
     49                                        _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
     50                                        'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
     51                                        number_format_i18n( $total_images )
     52                                );
     53                                                                ?>
     54                                        </em></p>
     55                                                <?php endif; // end twentyeleven_get_gallery_images() check ?>
    5056                        <?php the_excerpt(); ?>
    5157                <?php endif; ?>
    52                 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
     58                <?php
     59                wp_link_pages(
     60                        array(
     61                                'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>',
     62                                'after'  => '</div>',
     63                        )
     64                );
     65?>
    5366        </div><!-- .entry-content -->
    5467        <?php endif; ?>
     
    5972                        /* translators: used between list items, there is a space after the comma */
    6073                        $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    61                         if ( $categories_list ):
     74                if ( $categories_list ) :
    6275                ?>
    6376                <span class="cat-links">
    64                         <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    65                         $show_sep = true; ?>
     77                <?php
     78                        printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
     79                $show_sep = true;
     80                        ?>
    6681                </span>
    6782                <?php endif; // End if categories ?>
     
    6984                        /* translators: used between list items, there is a space after the comma */
    7085                        $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    71                         if ( $tags_list ):
    72                         if ( $show_sep ) : ?>
     86                if ( $tags_list ) :
     87                        if ( $show_sep ) :
     88                        ?>
    7389                <span class="sep"> | </span>
    7490                        <?php endif; // End if $show_sep ?>
    7591                <span class="tag-links">
    76                         <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
    77                         $show_sep = true; ?>
     92                        <?php
     93                        printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
     94                        $show_sep = true;
     95                        ?>
    7896                </span>
    7997                <?php endif; // End if $tags_list ?>
Note: See TracChangeset for help on using the changeset viewer.