-
-
Save sumonst21/37289db1dadec9bf78eaf152e855ad2b to your computer and use it in GitHub Desktop.
Facebook Post Debugger
This file contains hidden or 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 Post Debugger | |
Version: 0.1 | |
Plugin URI: http://jamesdigioia.com/ | |
Description: This plugin runs the bit.ly shortlink through the Facebook debugger upon publishing. | |
Author: James DiGioia | |
Author URI: http://www.jamesdigioia.com/ | |
*/ | |
add_filter( 'publish_post', 'fb_debug_link' ); | |
function fb_debug_link( $post ) { | |
$short = wp_get_shortlink($post['id']); | |
$url = 'https://graph.facebook.com/?id='.$short.'&scrape=true'; | |
wp_remote_post( $url ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment