Last active
August 29, 2015 14:01
-
-
Save ashfame/62f59587aaa5c8ecb1ce to your computer and use it in GitHub Desktop.
Forcing single thumbnail to be used on Facebook with "Facebook Like Thumbnail" plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Facebook Like Thumbnail - Force Default Image everywhere | |
* Plugin URI: https://gist.github.com/ashfame/62f59587aaa5c8ecb1ce | |
* Description: Forces the default image to be used as FB Thumbnail for every page | |
* Author: Ashfame | |
* Author URI: http://ashfame.com/ | |
*/ | |
add_filter( 'fb_like_thumbnail_shortcircuit', 'force_single_fb_thumbnail' ); | |
function force_single_fb_thumbnail( $shortcircuit ) { | |
if ( class_exists( 'Ashfame_Facebook_Like_Thumbnail' ) && ! empty( Ashfame_Facebook_Like_Thumbnail::$options['default'] ) ) { | |
return Ashfame_Facebook_Like_Thumbnail::$options['default']; | |
} | |
return $shortcircuit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment