Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashfame/62f59587aaa5c8ecb1ce to your computer and use it in GitHub Desktop.
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
<?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