Skip to content

Instantly share code, notes, and snippets.

@jeherve
Last active August 29, 2015 14:02
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/079a54c6805d6b82b892 to your computer and use it in GitHub Desktop.
Save jeherve/079a54c6805d6b82b892 to your computer and use it in GitHub Desktop.
[Jetpack] Change og:title value to be all uppercase
<?php
/*
* Plugin Name: Uppercase og:title for Jetpack
* Plugin URI: http://wordpress.org/extend/plugins/jetpack/
* Description: Removes Jetpack's default og:title tag, and replaces it with an uppercase og:title
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
function jeherve_capital_title_og( $tags ) {
global $post;
if ( is_singular() && $post ) {
unset( $tags['og:title'] );
$tags['og:title'] = strtoupper( get_the_title( $post->ID ) );
}
return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'jeherve_capital_title_og' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment