Skip to content

Instantly share code, notes, and snippets.

@webdados
Last active March 28, 2018 19:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/32f2669fbe7653520664be410e5a03b2 to your computer and use it in GitHub Desktop.
Save webdados/32f2669fbe7653520664be410e5a03b2 to your computer and use it in GitHub Desktop.
Facebook Open Graph, Google+ and Twitter Card Tags with Access Token
<?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;
}
@makmour
Copy link

makmour commented Mar 28, 2018

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