Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 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/twentyfifteen/image.php

    r30896 r42343  
    1515            <?php
    1616                // Start the loop.
    17                 while ( have_posts() ) : the_post();
     17            while ( have_posts() ) :
     18                the_post();
    1819            ?>
    1920
    20                 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     21            <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2122
    22                     <nav id="image-navigation" class="navigation image-navigation">
    23                         <div class="nav-links">
    24                             <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentyfifteen' ) ); ?></div>
    25                         </div><!-- .nav-links -->
    26                     </nav><!-- .image-navigation -->
     23                <nav id="image-navigation" class="navigation image-navigation">
     24                    <div class="nav-links">
     25                        <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentyfifteen' ) ); ?></div>
     26                    </div><!-- .nav-links -->
     27                </nav><!-- .image-navigation -->
    2728
    28                     <header class="entry-header">
    29                         <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    30                     </header><!-- .entry-header -->
     29                <header class="entry-header">
     30                    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
     31                </header><!-- .entry-header -->
    3132
    32                     <div class="entry-content">
     33                <div class="entry-content">
    3334
    34                         <div class="entry-attachment">
    35                             <?php
    36                                 /**
    37                                 * Filter the default Twenty Fifteen image attachment size.
    38                                 *
    39                                 * @since Twenty Fifteen 1.0
    40                                 *
    41                                 * @param string $image_size Image size. Default 'large'.
    42                                 */
    43                                 $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' );
     35                    <div class="entry-attachment">
     36                        <?php
     37                            /**
     38                            * Filter the default Twenty Fifteen image attachment size.
     39                            *
     40                            * @since Twenty Fifteen 1.0
     41                            *
     42                            * @param string $image_size Image size. Default 'large'.
     43                            */
     44                            $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' );
    4445
    45                                 echo wp_get_attachment_image( get_the_ID(), $image_size );
    46                             ?>
     46                            echo wp_get_attachment_image( get_the_ID(), $image_size );
     47                        ?>
    4748
    48                             <?php if ( has_excerpt() ) : ?>
     49                        <?php if ( has_excerpt() ) : ?>
    4950                                <div class="entry-caption">
    5051                                    <?php the_excerpt(); ?>
     
    5556
    5657                        <?php
    57                             the_content();
    58                             wp_link_pages( array(
     58                        the_content();
     59                        wp_link_pages(
     60                            array(
    5961                                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
    6062                                'after'       => '</div>',
     
    6365                                'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
    6466                                'separator'   => '<span class="screen-reader-text">, </span>',
    65                             ) );
    66                         ?>
     67                            )
     68                        );
     69                    ?>
    6770                    </div><!-- .entry-content -->
    6871
    6972                    <footer class="entry-footer">
    70                         <?php twentyfifteen_entry_meta(); ?>
     73                    <?php twentyfifteen_entry_meta(); ?>
    7174                        <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
    7275                    </footer><!-- .entry-footer -->
     
    7578
    7679                <?php
    77                     // If comments are open or we have at least one comment, load up the comment template
    78                     if ( comments_open() || get_comments_number() ) :
    79                         comments_template();
     80                // If comments are open or we have at least one comment, load up the comment template
     81                if ( comments_open() || get_comments_number() ) :
     82                    comments_template();
    8083                    endif;
    8184
    82                     // Previous/next post navigation.
    83                     the_post_navigation( array(
     85                // Previous/next post navigation.
     86                the_post_navigation(
     87                    array(
    8488                        'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen' ),
    85                     ) );
     89                    )
     90                );
    8691
    8792                // End the loop.
Note: See TracChangeset for help on using the changeset viewer.