One way to accomplish it is creating a plug-in that:
- Makes it mandatory
- Removes '(optional)' from the field label
- Shows an error message when appropriate
A filter module can be added to make it mandatory. Something like:
public function filter_question(&$question, &$errors, $oldquestion)
{
$userid = qa_get_logged_in_userid();
if (!isset($userid) && qa_opt('allow_anonymous_naming') && array_key_exists('name',$question) && empty($question['name']))
$errors['name'] = 'Please provide more information';
}
You might also include a custom language phrase here, rather than hard-coding it.
In addition, you can override qa-include/pages/ask.php and qa-include/pages/question.php such that the language phrase gets updated and the error message gets added (if any) after ask.php:297 (when creating questions) and question.php:241 (when editing questions). You can check qa_set_up_name_field() to know what the form looks like.
I hope this information is helpful.