Mistake in the Twitter Wordpress plugin documentation

documentation
wordpress

#1

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');

#2

Thanks for the feedback! I’ll pass this along.


#3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.