Skip to:
Content
Pages
Categories
Search
Top
Bottom

how to Replace some words in bp_activity_entry_meta ?


  • MonkimoE
    Participant

    @monkimoe

    Hi, I want replace some words in activity wall.
    I use this code in bp-custom.php but doesn’t work.

    function replace_content($content)
    {
     global $bp, $activity_template;
     $wordlist = array("word1", "word2", "word3");
    
        foreach ($wordlist as &$word) {
            $word = '/\b' . preg_quote($word, '/') . '\b/';
        }
    
        $content = preg_replace($wordlist, 'censored', $content);
        return $content;
    }
    add_filter('bp_activity_entry_meta','replace_content', 9);

    Any suggestion for proper code?

    Thank you.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘how to Replace some words in bp_activity_entry_meta ?’ is closed to new replies.
Skip to toolbar