Skip to content

Instantly share code, notes, and snippets.

@carasmo
Created October 30, 2017 19:08
Show Gist options
  • Save carasmo/2aea96d9d44acd4f15f39a38953693b1 to your computer and use it in GitHub Desktop.
Save carasmo/2aea96d9d44acd4f15f39a38953693b1 to your computer and use it in GitHub Desktop.
<?php
//DO NOT COPY THE ABOVE PHP tag -- change yourprefix_ in two locations
add_filter( 'pre_get_avatar_data', 'yourprefix_remove_gravatars_from_pinterest_choices', 10, 2 );
/**
* Add html5 atts on all avatars to remove from Pinterst choices
*/
function yourprefix_remove_gravatars_from_pinterest_choices( $args, $id_or_email ) {
$args['extra_attr'] = 'data-pin-no-hover="true" data-pin-nopin="true"';
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment