Make WordPress Core


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

    r40472 r42343  
    1515<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1616    <?php
    17         if ( is_sticky() && is_home() ) {
    18             echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
    19         }
     17    if ( is_sticky() && is_home() ) {
     18        echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
     19    }
    2020    ?>
    2121    <header class="entry-header">
    2222        <?php
    23             if ( 'post' === get_post_type() ) {
    24                 echo '<div class="entry-meta">';
    25                     if ( is_single() ) {
    26                         twentyseventeen_posted_on();
    27                     } else {
    28                         echo twentyseventeen_time_link();
    29                         twentyseventeen_edit_link();
    30                     };
     23        if ( 'post' === get_post_type() ) {
     24            echo '<div class="entry-meta">';
     25            if ( is_single() ) {
     26                twentyseventeen_posted_on();
     27            } else {
     28                echo twentyseventeen_time_link();
     29                twentyseventeen_edit_link();
     30            };
    3131                echo '</div><!-- .entry-meta -->';
    32             };
     32        };
    3333
    34             if ( is_single() ) {
    35                 the_title( '<h1 class="entry-title">', '</h1>' );
    36             } elseif ( is_front_page() && is_home() ) {
    37                 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
    38             } else {
    39                 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
    40             }
     34        if ( is_single() ) {
     35            the_title( '<h1 class="entry-title">', '</h1>' );
     36        } elseif ( is_front_page() && is_home() ) {
     37            the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
     38        } else {
     39            the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
     40        }
    4141        ?>
    4242    </header><!-- .entry-header -->
     
    5252    <div class="entry-content">
    5353
    54         <?php if ( is_single() || '' === get_the_post_thumbnail() ) {
     54        <?php
     55        if ( is_single() || '' === get_the_post_thumbnail() ) {
    5556
    5657            // Only show content if is a single post, or if there's no featured image.
    5758            /* translators: %s: Name of current post */
    58             the_content( sprintf(
    59                 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
    60                 get_the_title()
    61             ) );
     59            the_content(
     60                sprintf(
     61                    __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
     62                    get_the_title()
     63                )
     64            );
    6265
    63             wp_link_pages( array(
    64                 'before'      => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
    65                 'after'       => '</div>',
    66                 'link_before' => '<span class="page-number">',
    67                 'link_after'  => '</span>',
    68             ) );
     66            wp_link_pages(
     67                array(
     68                    'before'      => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
     69                    'after'       => '</div>',
     70                    'link_before' => '<span class="page-number">',
     71                    'link_after'  => '</span>',
     72                )
     73            );
    6974
    7075        };
Note: See TracChangeset for help on using the changeset viewer.