Making WordPress.org

Ticket #1751: 1751.diff

File 1751.diff, 2.8 KB (added by Kau-Boy, 7 years ago)
  • wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
    index bbdca08..bcded2b 100644
    class WordCamp_Post_Types_Plugin { 
    10971097                global $post;
    10981098
    10991099                $attr = shortcode_atts( array(
    1100                         'link' => 'none'
     1100                        'link' => 'none',
     1101                        'title' => 'visible',
     1102                        'content' => 'full',
     1103                        'excerpt_length' => 55,
    11011104                ), $attr );
    11021105
    11031106                $attr['link'] = strtolower( $attr['link'] );
    class WordCamp_Post_Types_Plugin { 
    11281131                                <?php $website = get_post_meta( get_the_ID(), '_wcpt_sponsor_website', true ); ?>
    11291132
    11301133                                <div id="wcorg-sponsor-<?php the_ID(); ?>" class="wcorg-sponsor">
    1131                                         <?php if ( 'website' == $attr['link'] && $website ) : ?>
    1132                                                 <h3><a href="<?php echo esc_attr( esc_url( $website ) ); ?>"><?php the_title(); ?></a></h3>
    1133                                         <?php else : ?>
    1134                                                 <h3><?php the_title(); ?></h3>
     1134                                        <?php if ( 'visible' === $attr['title'] ) : ?>
     1135                                                <?php if ( 'website' === $attr['link'] && $website ) : ?>
     1136                                                        <h3><a href="<?php echo esc_attr( esc_url( $website ) ); ?>"><?php the_title(); ?></a></h3>
     1137                                                <?php elseif ( 'post' === $attr['link'] ) : ?>
     1138                                                        <h3><a href="<?php echo esc_attr( esc_url( get_permalink() ) ); ?>"><?php the_title(); ?></a></h3>
     1139                                                <?php else : ?>
     1140                                                        <h3><?php the_title(); ?></h3>
     1141                                                <?php endif; ?>
    11351142                                        <?php endif; ?>
    11361143
    11371144                                        <div class="wcorg-sponsor-description">
    11381145                                                <?php if ( 'website' == $attr['link'] && $website ) : ?>
    11391146                                                        <a href="<?php echo esc_attr( esc_url( $website ) ); ?>">
    1140                                                                 <?php the_post_thumbnail( 'wcb-sponsor-logo-horizontal-2x' ); ?>
     1147                                                                <?php the_post_thumbnail( 'wcb-sponsor-logo-horizontal-2x', array( 'alt' => get_the_title() ) ); ?>
     1148                                                        </a>
     1149                                                <?php elseif ( 'post' == $attr['link'] ) : ?>
     1150                                                        <a href="<?php echo esc_attr( esc_url( get_permalink() ) ); ?>">
     1151                                                                <?php the_post_thumbnail( 'wcb-sponsor-logo-horizontal-2x', array( 'alt' => get_the_title() ) ); ?>
    11411152                                                        </a>
    11421153                                                <?php else : ?>
    1143                                                         <?php the_post_thumbnail( 'wcb-sponsor-logo-horizontal-2x' ); ?>
     1154                                                        <?php the_post_thumbnail( 'wcb-sponsor-logo-horizontal-2x', array( 'alt' => get_the_title() ) ); ?>
    11441155                                                <?php endif; ?>
    11451156
    1146                                                 <?php the_content(); ?>
     1157                                                <?php if ( 'full' === $attr['content'] ) : ?>
     1158                                                        <?php the_content(); ?>
     1159                                                <?php elseif ( 'excerpt' === $attr['content'] ) : ?>
     1160                                                        <?php echo wpautop(
     1161                                                                wp_trim_words(
     1162                                                                        get_the_content(),
     1163                                                                        intval( $attr['excerpt_length'] ),
     1164                                                                        apply_filters( 'excerpt_more', ' ' . '&hellip;' )
     1165                                                                )
     1166                                                        ); ?>
     1167                                                <?php endif; ?>
    11471168                                        </div>
    11481169                                </div><!-- #sponsor -->
    11491170                                <?php endwhile; ?>