Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
655 views
in Q2A Core by

i want a way to blocking words like help, please, ect in question title

Q2A version: 1.5.2

2 Answers

0 votes
by
admin > posting
0 votes
by

You will need to create a filter plugin. See http://question2answer.org/modules.php?module=filter

Use the filter_question function and check $question['title'] to see if it has those words in. If it does, you can do one of these:

1. Set it for moderation using $question['queued']=true;

2. Return a string containing the error, e.g. return 'Question cannot contain the word help';

3. Just remove the word from the title.

by
edited by

 Scot thanks, is this ok so,

function filter_question( &$question, &$errors, $oldquestion ) 
    if ( strpos($question['title'], 'help') !== false ) 
    $question['queued'] = true; 
}
by
Looks fine to me. Why don't you try it and see?
...