- Issue created by @stefank
If Q&A array is empty, we shouldn't render the object at all. If we use a token for acceptedAnswer, and that token is empty, we render e.g.:
{
"@type": "FAQPage",
"mainEntity": {
"@type": "Question",
"acceptedAnswer": {
"@type": "Answer"
}
}
}
Override SchemaQAPageMainEntity::output() like
public function output(): array {
$result = parent::output();
if (!isset($result['#attributes']['content'][0])) {
return [];
}
else {
return $result;
}
}
Patch.
None.
Active
3.0
Code