Making WordPress.org

Changeset 8762


Ignore:
Timestamp:
05/09/2019 06:45:18 PM (3 years ago)
Author:
vedjain
Message:

WC Campsite17: Adds featured image support with feature flag.

In an earlier patch r8748, Jetpack's content options was used to add featured image support. For backwards compatibility, this was disabled by default using a feature flag on all existing sites.

This caused an issue because content options were removing featured images on *all* renders including in blocks and shortcode. Therefore r8748 was eventually reverted in r8753.

This patch adds featured image support natively instead of using Jetpack Content Support so as to not disable images in blocks and shortcodes. This also means that if any exisiting camp needs featured image supported, they would have to request to have the backwards compatibility flag removed for them.

See #3645 #4339

Location:
sites/trunk/wordcamp.org/public_html/wp-content/themes/campsite-2017/template-parts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/campsite-2017/template-parts/content-page.php

    r8753 r8762  
    1414<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1515    <header class="entry-header">
     16        <?php if ( has_post_thumbnail() && ! wcorg_skip_feature( 'cs17_display_featured_image' ) ) : ?>
     17            <div class="entry-image">
     18                <?php the_post_thumbnail(); ?>
     19            </div>
     20        <?php endif; ?>
     21
    1622        <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    1723    </header>
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/campsite-2017/template-parts/content-search.php

    r8753 r8762  
    1414<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1515    <header class="entry-header">
     16        <?php if ( has_post_thumbnail() && ! wcorg_skip_feature( 'cs17_display_featured_image' ) ) : ?>
     17            <div class="entry-image">
     18                <?php the_post_thumbnail(); ?>
     19            </div>
     20        <?php endif; ?>
     21
    1622        <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
    1723
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/campsite-2017/template-parts/content.php

    r8753 r8762  
    1515    <header class="entry-header">
    1616        <?php
     17
     18        if ( has_post_thumbnail() && ! wcorg_skip_feature( 'cs17_display_featured_image' ) ) : ?>
     19            <div class="entry-image">
     20                <?php the_post_thumbnail(); ?>
     21            </div>
     22        <?php endif;
    1723
    1824        if ( is_single() ) {
Note: See TracChangeset for help on using the changeset viewer.