Last active
August 29, 2015 14:02
-
-
Save jeherve/079a54c6805d6b82b892 to your computer and use it in GitHub Desktop.
[Jetpack] Change og:title value to be all uppercase
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 | |
/* | |
* 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