bbp_get_topic_tag_link( $tag = '' )

Return the link of the current tag

Description

Return

(string) Term Name

Source

File: bp-forums/topics/template.php

3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
function bbp_get_topic_tag_link( $tag = '' ) {
 
    // Get the term
    if ( ! empty( $tag ) ) {
        $term = get_term_by( 'slug', $tag, bbp_get_topic_tag_tax_id() );
    } else {
        $tag  = get_query_var( 'term' );
        $term = get_queried_object();
    }
 
    // Add before and after if description exists
    if ( !empty( $term->term_id ) ) {
        $retval = get_term_link( $term, bbp_get_topic_tag_tax_id() );
 
    // No link
    } else {
        $retval = '';
    }
 
    return apply_filters( 'bbp_get_topic_tag_link', $retval, $tag );
}

Changelog

Changelog
Version Description
bbPress (r3348) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.