bbp_get_topic_tag_id( $tag = '' )

Return the id of the current tag

Description

Return

(string) Term Name

Source

File: bp-forums/topics/template.php

3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
function bbp_get_topic_tag_id( $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 = $term->term_id;
 
    // No id
    } else {
        $retval = '';
    }
 
    return (int) apply_filters( 'bbp_get_topic_tag_id', (int) $retval, $tag );
}

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.