Last active
March 28, 2018 19:38
-
-
Save webdados/32f2669fbe7653520664be410e5a03b2 to your computer and use it in GitHub Desktop.
Facebook Open Graph, Google+ and Twitter Card Tags with Access Token
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 | |
/* | |
If you want the "Facebook Open Graph, Google+ and Twitter Card Tags" WordPress plugin to be able | |
to clear/update the cache of your posts and pages, you'll need to create a facebook app and add | |
it's ID and secret to the URL. | |
1) Go to https://developers.facebook.com/apps/ and create a new app (or choose and existant one, any app will do) | |
2) Copy the App ID and App Secret from your app dashboard | |
3) Add this to your (child-)theme's functions.php file and replace MY_APP_ID and MY_APP_SECRET with your app details | |
*/ | |
add_filter( 'fb_og_update_cache_url', 'my_fb_og_update_cache_url' ); | |
function my_fb_og_update_cache_url( $url ) { | |
$url .= '&access_token=MY_APP_ID|MY_APP_SECRET'; | |
return $url; | |
} |
Use the snippet in your child theme functions.php file. You can omit the <?php opening tag.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have to include this file in the plugin directory and you're done?