Quantcast
Channel: WordPress.org Forums » [Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Support
Viewing all articles
Browse latest Browse all 42467

ladislav.soukup@gmail.com on "[Plugin: WordPress SEO by Yoast] filter "wpseo_opengraph_image" Twitter VS Facebook inconsistency"

$
0
0

FYI:

this "fix" of public function image() in class-twitter.php is working

/**
* Displays the image for Twitter
*
* Only used when OpenGraph is inactive.
*/
public function image() {
	global $post;

	if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
		$featured_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'medium' ) );

		if ( $featured_img ) {
			$img = apply_filters( 'wpseo_opengraph_image', $featured_img[0] );
			echo "<meta name='twitter:image' content='" . esc_attr( $img ) . "'>\n";
		}
	} else {
		$options = get_wpseo_options();
		if ( isset( $options['og_frontpage_image'] ) && !empty( $options['og_frontpage_image'] ) )
			$img = apply_filters( 'wpseo_opengraph_image', $options['og_frontpage_image'] );
			echo "<meta name='twitter:image' content='" . esc_attr( $img ) . "'>\n";
	}

}

Viewing all articles
Browse latest Browse all 42467

Trending Articles