WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/01/2019 02:31:50 PM (12 months ago)
Author:
vedjain
Message:

WordCamp Block: Add excerpt support to Sponsor block for consistency

We already support excerpt in Speakers, Sessions and (WIP) Organizer block. This patch also adds support to show excerpt in Sponsor Block, thereby ensuring consistency among all blocks.

Fixes https://github.com/WordPress/wordcamp.org/issues/38

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/view/sponsors.php

    r8541 r8559  
    3232    <?php } ?>
    3333
    34     <?php if ( $attributes['show_desc'] ) { ?>
    35         <?php echo wp_kses_post( wpautop( get_all_the_content( $sponsor ) ) ); ?>
     34    <?php if ( 'none' !== $attributes['content'] ) { ?>
     35        <?php if ( 'full' === $attributes['content'] ) { ?>
     36            <?php echo wp_kses_post( wpautop( get_all_the_content( $sponsor ) ) ); ?>
     37        <?php } elseif ( 'excerpt' === $attributes['content'] ) { ?>
     38            <?php wpautop( the_excerpt() ); ?>
     39            <?php if ( true === $attributes['excerpt_more'] ) { ?>
     40                <p class="wordcamp-item-permalink">
     41                    <a href="<?php echo esc_url( get_permalink( $sponsor ) ); ?>" class="wordcamp-sponsor-permalink">
     42                        <?php esc_html_e( 'Read more', 'wordcamporg' ); ?>
     43                    </a>
     44                </p>
     45            <?php } ?>
     46        <?php } ?>
    3647    <?php } ?>
    3748
Note: See TracChangeset for help on using the changeset viewer.