Skip to content

Instantly share code, notes, and snippets.

@joeyblake
Created November 1, 2014 14:46
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 joeyblake/2f7264d3070d51732fa8 to your computer and use it in GitHub Desktop.
Save joeyblake/2f7264d3070d51732fa8 to your computer and use it in GitHub Desktop.
SharePress replace open graph meta data filter
//Add this to your theme's functions.php file
//Modify the function to add the custom field value you are looking for
add_filter('sharepress_og_tags', 'my_sharepress_og_tags');
function my_sharepress_og_tags( $og ) {
global $post;
$stripped_quotes = str_replace( '"', '', $og['og:title'] );
$og = array_merge($og, array(
'og:title' => $strip_quotes
));
return $og;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment