Making WordPress.org

Changeset 932


Ignore:
Timestamp:
10/25/2014 04:12:51 AM (10 years ago)
Author:
iandunn
Message:

Add speaker_link param to [speakers] shortcode.

props codebykat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php

    r921 r932  
    258258            'order' => 'desc',
    259259            'track' => 'all',
     260            'speaker_link' => '',
    260261        ), $attr );
    261262
     
    263264        $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ) ? $attr['orderby'] : 'date';
    264265        $attr['order'] = ( in_array( $attr['order'], array( 'asc', 'desc') ) ) ? $attr['order'] : 'desc';
     266        $attr['speaker_link'] = ( in_array( $attr['speaker_link'], array( 'permalink' ) ) ) ? $attr['speaker_link'] : '';
    265267
    266268        /*
     
    351353                <!-- Organizers note: The id attribute is deprecated and only remains for backwards compatibility, please use the corresponding class to target individual speakers -->
    352354                <div id="wcorg-speaker-<?php echo sanitize_html_class( $post->post_name ); ?>" class="<?php echo implode( ' ', $speaker_classes ); ?>">
    353                     <h2><?php the_title(); ?></h2>
     355                    <h2>
     356                        <?php if ( 'permalink' === $attr['speaker_link'] ) : ?>
     357                            <a href="<?php the_permalink(); ?>">
     358                                <?php the_title(); ?>
     359                            </a>
     360                        <?php else : ?>
     361                            <?php the_title(); ?>
     362                        <?php endif; ?>
     363                    </h2>
    354364                    <div class="wcorg-speaker-description">
    355365                        <?php echo ( $attr['show_avatars'] ) ? get_avatar( get_post_meta( get_the_ID(), '_wcb_speaker_email', true ), absint( $attr['avatar_size'] ) ) : ''; ?>
Note: See TracChangeset for help on using the changeset viewer.