WordPress.org

Making WordPress.org

Changeset 3730


Ignore:
Timestamp:
07/28/2016 05:21:02 PM (4 years ago)
Author:
jmdodd
Message:

Forums Theme: Add subscription link to tag archive pages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/functions.php

    r3616 r3730  
    323323    <?php endif;
    324324}
     325
     326function bb_base_before_topics_loop() {
     327    do_action( 'bbp_template_notices' );
     328
     329    if ( ! is_tax( 'topic-tag' ) ) {
     330        return;
     331    }
     332
     333    $term_subscription = '';
     334    if ( function_exists( 'WordPressdotorg\Forums\Term_Subscription\get_subscription_link' ) ) {
     335        $term_subscription = WordPressdotorg\Forums\Term_Subscription\get_subscription_link( get_queried_object()->term_id );
     336    }
     337    ?>
     338    <div id="topic-tag" class="bbp-topic-tag">
     339    <h1 class="entry-title"><?php printf( esc_html__( 'Topic Tag: %s', 'bbpress' ), '<span>' . bbp_get_topic_tag_name() . '</span>' ); ?></h1>
     340    <?php if ( ! empty( $term_subscription ) ) : ?><h2><?php echo $term_subscription; ?></h2><?php endif; ?>
     341        <div class="entry-content">
     342    <?php
     343}
     344add_action( 'bbp_template_before_topics_loop', 'bb_base_before_topics_loop' );
     345
     346function bb_base_after_topics_loop() {
     347    if ( ! is_tax( 'topic-tag' ) ) {
     348        return;
     349    }
     350    ?>
     351        </div>
     352    </div><!-- #topic-tag -->
     353    <?php
     354}
     355add_action( 'bbp_template_after_topics_loop', 'bb_base_after_topics_loop' );
Note: See TracChangeset for help on using the changeset viewer.