Skip to:
Content
Pages
Categories
Search
Top
Bottom

Overwrite Bbpress class


  • tomcrise
    Participant

    @tomcrise

    Hello,

    I found a bug when using bbrpess and WOOF (Woocommerce Product Filter). Indeed, when bbpress is activated, when you want to filter products by category, the WOOF’s widget disappears. With a lot of tests on multiples websites, I found this bug comes from bbpess.phpclass on setup_variables() function when the attribute topic_tag_tax_id gets apply_filters( 'bbp_topic_tag_tax_id', 'topic-tag' ) value. When you comment this line, the bug is solve.
    As I don’t need tags on my Forum, I just need to set $this->topic_tag_tax_id = 0 and hide Topic tags form.

    But Here is my final problem : How can I overwrite this class because it’s not a template but the plugin file ?

    PS : I tried every possibilities (plugins versions, select another theme, change product database, catch network and files errors), the bug really comes from here as strange as it may seem.

    Cheers,

    TomCrise

Viewing 3 replies - 1 through 3 (of 3 total)

  • Robin W
    Moderator

    @robin-w

    that line allows the result to be filtered

    so this should work

    add_filter ('bbp_topic_tag_tax_id' , 'rew_return_null') ;
    
    function rew_return_null () {
    return ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    tomcrise
    Participant

    @tomcrise

    Thank’s for your help. I tried but it didn’t fix the problem, I think the problem comes from elsewhere in the plugin but on this variable. Do you have any idea what this might have to do with product filtering plugin (WOOF)?


    Robin W
    Moderator

    @robin-w

    so have you tried

    add_filter ('bbp_topic_tag_tax_id' , 'rew_return_null') ;
    
    function rew_return_null () {
    return 0 ;
    }

    or

    add_filter ('bbp_topic_tag_tax_id' , 'rew_return_null') ;
    
    function rew_return_null () {
    return false ;
    }

    or indeed

    add_filter ('bbp_topic_tag_tax_id' , 'rew_return_null') ;
    
    function rew_return_null () {
    return 'hello' ;
    }

    it would appear to be a known issue

    https://pluginus.net/support/topic/first-filter-disappears-when-set/

    otherwise suggest you raise with woof

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