My goal was to remove all best answer outputs from the question page.
On layer level (not overrides) I have tried to remove the best answer.
These attempts were not successful:
public function a_list_items($a_items)
{
foreach ($a_items as $a_item) {
$a_item['raw']['isselected'] = false;
$a_item['selected'] = false;
$this->a_list_item($a_item);
}
}
Then I saw that format.php adds the css class (!) as an extra field:
$fields['classes'].=' hentry '.($isquestion ? 'question' : ($isanswer ? ($isselected ? 'answer answer-selected' : 'answer') : 'comment'));
So the only chance (again: not using core function overrides) to remove the selected best answer, is to remove the css class from $a_item['classes']:
public function a_list_items($a_items)
{
foreach ($a_items as $a_item) {
$a_item['classes'] = str_replace(' answer-selected', '', $a_item['classes']);
if(isset($a_item['select_text'])) {
unset($a_item['select_text']);
}
$this->a_list_item($a_item);
}
}
I am not sure... in my special case I think the current q2a core way is not the best implementation. What do you think?