Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding topic tag filter in recent topics widget


  • vinzen
    Participant

    @vinzen

    I wanted to filter the recent forum topics not only by their parent forum but also by their topic tags.

    I fiddled with the widgets.php that I found at wp-content/plugins/bbpress/includes/common/.

    I’m not a programmer yet I achieved the widget interface to contain the field for topic tag.

    Screenshot of Recent Topics Widget

    Though it looks good, its not working. The topics are not filtered by the desired topic tag. In fact, it is not making any difference.

    I think the problem is about not getting the field ID for the topic tag. Or, there isn’t any filter for sorting topic tags.

    I searched the entire BBPress support forums but did not find any similar post or problem.

    I wish to know is it right to use the following:

    $instance['topic_tag'] = sanitize_text_field( $new_instance['topic_tag'] );

    get_field_name( 'topic_tag' );

    Should I use –

    'post_topic_tag' => $settings['topic_tag'],

    or

    'post_topic_tag' => bbp_get_topic_tag_tax_id(),

    I came across a somewhat related topic https://bbpress.org/forums/topic/topic-tag-archive-wrongly-displaying-all-topics/

    It suggests to use this –

    if( bbp_has_topics( array( bbp_get_topic_tag_tax_id() => bbp_get_topic_tag_slug() ) ) )

    Now, I’ve tried all of these and I’m getting nowhere.

    I hope the experts here will spot out the problem and help me sort out my widget in the way I want.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar