Skip to content

Instantly share code, notes, and snippets.

@jeherve
Created July 23, 2014 10:32
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 jeherve/623b3a5bc5bf2b35352d to your computer and use it in GitHub Desktop.
Save jeherve/623b3a5bc5bf2b35352d to your computer and use it in GitHub Desktop.
[Jetpack] Verify your site with Facebook by adding an admin meta tag to the head of your site. Works when Jetpack is enabled. http://i.wpne.ws/WiUs
<?php
/*
* Plugin Name: Verify your site with Facebook
* Plugin URI: http://wordpress.org/plugins
* Description: Verify your site with Facebook by adding an admin meta tag to the head of your site. Works when Jetpack is enabled.
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremy.hu
* License: GPL2+
*/
/*
* Force Jetpack to display Open Graph meta tags
* Even when they have been disabled by another plugin
*/
add_filter( 'jetpack_enable_open_graph', '__return_true', 100 );
/*
* Add Facebook Admin meta tag to the head
* To find your Facebook ID, visit this page
* http://findmyfacebookid.com/
*
* Facebook Admin tag docs are available here:
* https://developers.facebook.com/docs/insights
*/
function jeherve_fb_admin( $tags ) {
$fb_admin = '611546862'; // Paste your own Facebook ID here
$tags['fb:admins'] = absint( $fb_admin );
return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'jeherve_fb_admin' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment