🔞 ADULT: Changeset/ - Complete Album!

Changeset 44298


Ignore:
Timestamp:
12/18/2018 10:08:33 PM (7 years ago)
Author:
desrosj
Message:

Twenty Nineteen: Code Quality Improvements.

This change adds general code quality and documentation improvements.

More info here: https://github.com/WordPress/twentynineteen/pull/546

Props grapplerulrich, iCaleb, allancole.

Merges [44187] to trunk.

See #45424.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-content/themes/twentynineteen/archive.php

    r44149 r44298  
    2121                <?php
    2222                    the_archive_title( '<h1 class="page-title">', '</h1>' );
    23                     // Remove for now @TODO
    24                     // the_archive_description( '<div class="page-description">', '</div>' );
    2523                ?>
    2624            </header><!-- .page-header -->
  • trunk/src/wp-content/themes/twentynineteen/functions.php

    r44149 r44298  
    264264    require_once get_parent_theme_file_path( '/inc/color-patterns.php' );
    265265
    266     if ( 'default' === get_theme_mod( 'primary_color', 'default' ) ) {
    267         $primary_color = 199;
    268     } else {
    269         $primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) );
     266    $primary_color = 199;
     267    if ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) {
     268        $primary_color = get_theme_mod( 'primary_color_hue', 199 );
    270269    }
    271270    ?>
    272271
    273     <style type="text/css" id="custom-theme-colors" <?php echo is_customize_preview() ? 'data-hue="' . $primary_color . '"' : ''; ?>>
     272    <style type="text/css" id="custom-theme-colors" <?php echo is_customize_preview() ? 'data-hue="' . absint( $primary_color ) . '"' : ''; ?>>
    274273        <?php echo twentynineteen_custom_colors_css(); ?>
    275274    </style>
  • trunk/src/wp-content/themes/twentynineteen/header.php

    r44149 r44298  
    3232            <?php if ( is_singular() && twentynineteen_can_show_post_thumbnail() ) : ?>
    3333                <div class="site-featured-image">
    34                     <?php twentynineteen_post_thumbnail(); ?>
    35                     <?php the_post(); ?>
    36                     <?php $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>
    37                     <div class="<?php echo ( ! empty( $discussion ) && count( $discussion->responses ) > 0 ) ? 'entry-header has-discussion' : 'entry-header'; ?>">
     34                    <?php
     35                        twentynineteen_post_thumbnail();
     36                        the_post();
     37                        $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null;
     38
     39                        $classes = 'entry-header';
     40                    if ( ! empty( $discussion ) && count( $discussion->responses ) > 0 ) {
     41                        $classes = 'entry-header has-discussion';
     42                    }
     43                    ?>
     44                    <div class="<?php echo $classes; ?>">
    3845                        <?php get_template_part( 'template-parts/header/entry', 'header' ); ?>
    3946                    </div><!-- .entry-header -->
  • trunk/src/wp-content/themes/twentynineteen/image.php

    r44155 r44298  
    4242                        ?>
    4343
    44                             <figcaption class="wp-caption-text"><?php echo get_the_excerpt(); ?></figcaption>
     44                            <figcaption class="wp-caption-text"><?php the_excerpt(); ?></figcaption>
    4545
    4646                        </figure><!-- .entry-attachment -->
  • trunk/src/wp-content/themes/twentynineteen/inc/color-patterns.php

    r44155