Skip to:
Content
Pages
Categories
Search
Top
Bottom

Find and replace a single word within bbpress topics and replies


  • knelsonkris
    Participant

    @knelsonkris

    I am trying to replace a brand name throughout my entire site using a php function and an add filter. Works great, but I cannot seem to get to the bbpress “content”. What I am trying to do is:

    add_filter(‘the_content’, ‘replace_text’);

    where “the content” includes a topic or a reply within bbpress. I have no idea what “the content” would be.

    Any help would be appreciated

    Kris

Viewing 1 replies (of 1 total)

  • Robin W
    Moderator

    @robin-w

    presuming ‘replace_text’ does the heavy lifting, then

    add_filter( 'bbp_get_reply_content',  ‘replace_text' ) ;
    add_filter( 'bbp_get_topic_content', ' ‘replace_text’ );
    
    with replace text looking like
    
    replace_text ($content) {
    //stuff to do the replacing....
    return $content ;
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar