Making WordPress.org


Ignore:
Timestamp:
05/08/2019 04:30:59 PM (6 years ago)
Author:
vedjain
Message:

WC Campsite17: Content option support for featured image in custom CPT.

This patch adds featured image support to Custom Post Types as well like sponsors. This uses JetPack's content option feature so that displaying featured image is customizable.

For back compatibility in previous sites, this would disabled by default, and will enabled only for new WordCamp sites. Old WordCamp sites can enable this by going to Customizer->ContentOptions.

Fixes #3645 #4339
Props ryelle, vedjain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/campsite-2017/inc/jetpack.php

    r5536 r8748  
    1616 *
    1717 * See: https://jetpack.com/support/infinite-scroll/
     18 * See: https://jetpack.com/support/content-options/
    1819 * See: https://jetpack.com/support/responsive-videos/
    1920 */
     
    2526            'render'    => __NAMESPACE__ . '\infinite_scroll_render',
    2627            'footer'    => 'page',
     28        )
     29    );
     30
     31    $featured_image_enabled = ! wcorg_skip_feature( 'cs17_display_featured_image' );
     32    add_theme_support(
     33        'jetpack-content-options',
     34        array(
     35            'featured-images'    => array(
     36                'archive'           => true,
     37                'archive-default'   => $featured_image_enabled,
     38                'post'              => true,
     39                'post-default'      => $featured_image_enabled,
     40                'page'              => true,
     41                'page-default'      => $featured_image_enabled,
     42                'fallback'          => false,
     43            ),
    2744        )
    2845    );
Note: See TracChangeset for help on using the changeset viewer.