bbp_get_topic_tag_slug( $tag = '' )

Return the slug of the current tag

Description

Return

(string) Term Name

Source

File: bp-forums/topics/template.php

3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
function bbp_get_topic_tag_slug( $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->slug ) ) {
        $retval = $term->slug;
 
    // No slug
    } else {
        $retval = '';
    }
 
    return apply_filters( 'bbp_get_topic_tag_slug', $retval );
}

Changelog

Changelog
Version Description
bbPress (r3109) 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.