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

WordPress version: 3.5
WordPress SEO version: 1.3.4.4

I have one custom post type that is loading data from external API and is not using integrated post thumbnail. I'm trying to override the og:image and twitter:image tags (I have default images set).

I have found a very useful filter "wpseo_opengraph_image" in the source code, but there is "bug" or inconsistency between "class-opengraph.php" and "class-twitter.php".

Opengraph class is trying to fetch image from post_thumbnail, then load default and then it is applying the filter, so image can be rewritten in all cases.
Twitter class is first doing the check if post_thumbnail exists and then rewrite can be applied to override the post_thumbnail, but if no post thumbnail exists, class will use the default image without using the filter "wpseo_opengraph_image", so no rewrite option exists.

In short...
If there is no post_thumbnail, "wpseo_opengraph_image" filter is working on open graph tag, but is not working on twitter:image tag.

This is not a show-stopper and I can "fix" the code for now.
Please try to look at it, it seems, that opengraph class is newer then twitter class ;)

http://wordpress.org/extend/plugins/wordpress-seo/


Viewing all articles
Browse latest Browse all 42467

Trending Articles