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/twentyseventeen/template-parts/page/content-front-page-panels.php

    r39286 r42343  
    1515<article id="panel<?php echo $twentyseventeencounter; ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> >
    1616
    17         <?php if ( has_post_thumbnail() ) :
     17        <?php
     18        if ( has_post_thumbnail() ) :
    1819                $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
    1920
     
    4041                                <?php
    4142                                        /* translators: %s: Name of current post */
    42                                         the_content( sprintf(
    43                                                 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
    44                                                 get_the_title()
    45                                         ) );
     43                                        the_content(
     44                                                sprintf(
     45                                                        __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
     46                                                        get_the_title()
     47                                                )
     48                                        );
    4649                                ?>
    4750                        </div><!-- .entry-content -->
     
    4952                        <?php
    5053                        // Show recent blog posts if is blog posts page (Note that get_option returns a string, so we're casting the result as an int).
    51                         if ( get_the_ID() === (int) get_option( 'page_for_posts' )  ) : ?>
     54                        if ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) :
     55                        ?>
    5256
    53                                 <?php // Show four most recent posts.
    54                                 $recent_posts = new WP_Query( array(
    55                                         'posts_per_page'      => 3,
    56                                         'post_status'         => 'publish',
    57                                         'ignore_sticky_posts' => true,
    58                                         'no_found_rows'       => true,
    59                                 ) );
     57                                <?php
     58                                // Show four most recent posts.
     59                                $recent_posts = new WP_Query(
     60                                        array(
     61                                                'posts_per_page'      => 3,
     62                                                'post_status'         => 'publish',
     63                                                'ignore_sticky_posts' => true,
     64                                                'no_found_rows'       => true,
     65                                        )
     66                                );
    6067                                ?>
    6168
    62                                 <?php if ( $recent_posts->have_posts() ) : ?>
     69                                <?php if ( $recent_posts->have_posts() ) : ?>
    6370
    6471                                        <div class="recent-posts">
    6572
    6673                                                <?php
    67                                                 while ( $recent_posts->have_posts() ) : $recent_posts->the_post();
     74                                                while ( $recent_posts->have_posts() ) :
     75                                                        $recent_posts->the_post();
    6876                                                        get_template_part( 'template-parts/post/content', 'excerpt' );
    6977                                                endwhile;
Note: See TracChangeset for help on using the changeset viewer.