Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (6 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-video.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 -->
     
    4444    <?php
    4545        $content = apply_filters( 'the_content', get_the_content() );
    46         $video = false;
     46        $video   = false;
    4747
    4848        // Only get video from the content if a playlist isn't present.
    49         if ( false === strpos( $content, 'wp-playlist-script' ) ) {
    50             $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
    51         }
     49    if ( false === strpos( $content, 'wp-playlist-script' ) ) {
     50        $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
     51    }
    5252    ?>
    5353
     
    7979
    8080            /* translators: %s: Name of current post */
    81             the_content( sprintf(
    82                 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
    83                 get_the_title()
    84             ) );
     81            the_content(
     82                sprintf(
     83                    __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
     84                    get_the_title()
     85                )
     86            );
    8587
    86             wp_link_pages( array(
    87                 'before'      => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
    88                 'after'       => '</div>',
    89                 'link_before' => '<span class="page-number">',
    90                 'link_after'  => '</span>',
    91             ) );
     88            wp_link_pages(
     89                array(
     90                    'before'      => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
     91                    'after'       => '</div>',
     92                    'link_before' => '<span class="page-number">',
     93                    'link_after'  => '</span>',
     94                )
     95            );
    9296        };
    9397        ?>
Note: See TracChangeset for help on using the changeset viewer.