Just replace your if statement with:
if
if(in_array($menu_item->post_title, ['twitter','linkedin'])) { $schema['sameAs'][] = $menu_item->url; }
548k questions
547k answers
4 comments
86.3k users