Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+9 votes
536 views
in Q2A Core by
can you add bad words filter in admin panel?

2 Answers

+3 votes
by
It's a good idea. I'm afraid it won't make it into version 1.0, but I've put it on the roadmap.
+2 votes
by
edited by
You could modify the code to add this in yourself, I did something similar. Here's how:

1. Add a function, e.g. "qa_content_format" to qa-util-string.php to format the string. In your case you might have something like:

    function qa_content_format($string)
    {
        $search = array( 'shit', 'fuck' );
        $replace = array( 's***', 'f***' );
        return str_replace( $search, $replace, $string );
    }

2. In qa-app-post-create.php call that function from the first line of the functions 'qa_question_create', 'qa_answer_create' and 'qa_comment_create' for the title and/or content, e.g.

    $title = qa_content_format($title);
    $content = qa_content_format($content);

3. Do the same in qa-app-post-update.php for the functions 'qa_question_set_text', 'qa_answer_set_text', 'qa_comment_set_text'.
...