Skip to:
Content
Pages
Categories
Search
Top
Bottom

Correct filters for removing wptexturize


  • SquarePenguin
    Participant

    @squarepenguin

    Hello,

    Could anyone point me in the right direction so I can identify the filters used in bbpress so that I might remove wptexturize?

    I have identified those required for WordPress itself, but bbpress appears to use different filters. The WordPress ones I successfully used are:

    remove_filter( ‘the_title’, ‘wptexturize’ );
    remove_filter( ‘the_content’, ‘wptexturize’ );
    remove_filter( ‘the_excerpt’, ‘wptexturize’ );
    remove_filter( ‘comment_text’, ‘wptexturize’ );

    Which I added to functions.php of a child theme.

    I then identified what I thought were the required filters in bbpress from here:

    http://etivite.com/api-hooks/bbpress/trigger/apply_filters/bbp_get_topic_content/

    …and added the following to functions.php to no effect:

    remove_filter( ‘bbp_get_reply_content’, ‘wptexturize’);
    remove_filter( ‘bbp_get_topic_content’, ‘wptexturize’);

    These filters do not work, so I assume they are not the correct ones. Any ideas what the correct filters are?

    Thank you!

Viewing 1 replies (of 1 total)

  • stjaymz
    Participant

    @stjaymz

    Funny. BBPress need to remove those filters on this forum too. When I copied and pasted your example, I had to go back and remove the fancy quotes.

    Anyway, found the solution :

    When removing the filter, the priority has to be the same as when the filter was added. The filters are added in : /bbpress/includes/core/filters.php with a priority of 3.

    So, to successfully remove those filters from functions.php, add in the priority :

    remove_filter( 'bbp_get_reply_content', 'wptexturize' , 3);
    remove_filter( 'bbp_get_topic_content', 'wptexturize', 3);
    
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.