Skip to content

Commit c8700e6

Browse files
committed
Twitter Cards: fallback if there is no existing image card
1 parent 6ef9120 commit c8700e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: class.jetpack-twitter-cards.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ static function twitter_cards_define_type_based_on_image_count( $og_tags, $extra
133133
}
134134

135135
// Second fall back, Site Logo
136-
if ( empty( $img_count ) && ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) ) {
136+
if ( empty( $og_tags['twitter:image'] ) && ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) ) {
137137
$og_tags['twitter:image'] = jetpack_get_site_logo( 'url' );
138138
}
139139

140140
// Third fall back, Site Icon
141-
if ( empty( $img_count ) && ( function_exists( 'jetpack_has_site_icon' ) && jetpack_has_site_icon() ) ) {
141+
if ( empty( $og_tags['twitter:image'] ) && ( function_exists( 'jetpack_has_site_icon' ) && jetpack_has_site_icon() ) ) {
142142
$og_tags['twitter:image'] = jetpack_site_icon_url( '240' );
143143
}
144144

0 commit comments

Comments
 (0)