Hello,
I noticed a clear and small mistake in “Twitter Cards in WordPress”: https://dev.twitter.com/web/wordpress/cards
Under the very last heading, “twitter_card”, the function in the example code should return the input variable. Otherwise the example clears the meta properties and doesn’t add anything.
function twitter_card( $card_properties )
{
if ( empty( $card_properties['image'] ) ) {
$card_properties['image'] = 'https://example.com/logo.jpg';
}
return $card_properties;
}
add_filter('twitter_card', 'twitter_card');