pfefferle / wordpress-opengraph

Open Graph plugin for WordPress
http://wordpress.org/plugins/opengraph/
Apache License 2.0
22 stars 13 forks source link

Jetpack Open Graph still present #13

Closed pfefferle closed 12 years ago

pfefferle commented 12 years ago

I don't know exactly why but the Jetpack Open Graph are still present.

I tried to debug the filter with this small plugin and that seems to work perfect https://gist.github.com/4067444 (the last result is false)

Do you have any ideas?

I don't use any caching.

pfefferle commented 12 years ago

the functions.opengraph.php file also uses a filter:

if ( false === apply_filters( 'jetpack_enable_open_graph', true ) )
        return;

(with an underscore between "open" and "graph")

If I use that filter it works as it should work:

add_filter( 'jetpack_enable_open_graph', '__return_false', 99 );
pfefferle commented 12 years ago

...and thats also what the automattic employee suggests http://kovshenin.com/2012/double-titles-when-sharing-on-google/

willnorris commented 12 years ago

yeah, looking more closely at jetpack.php, it's actually really poorly designed, since the 'jetpack_enable_opengraph' filter is being called on plugin load, rather than on something like the 'wp' action. So it doesn't really give other plugins a chance to override it, depending on when they happen to get loaded (is it alphabetically maybe?). So then we should just add another filter to opengraph.php that also returns false for 'jetpack_enable_open_graph'.

willnorris commented 12 years ago

@pfefferle: try that and see if it works for you (I don't currently have jetpack installed)

pfefferle commented 12 years ago

works perfect and looks exactly like my hotfix ;)