Skip to content

Instantly share code, notes, and snippets.

@salvatorecapolupo
Created July 16, 2017 13:36
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 salvatorecapolupo/bb0392f70363e30fb2fc1052a6322004 to your computer and use it in GitHub Desktop.
Save salvatorecapolupo/bb0392f70363e30fb2fc1052a6322004 to your computer and use it in GitHub Desktop.
All you don't really need in WP. Please disable carefully!
<?PHP
//note: you should use these hook in functions.php file and / or (mu)plugin
//disable WordPress emoji
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
//disable Gravatars support
function __default_local_avatar()
{
// this assumes default_avatar.png is in wp-content/themes/active-theme/images
return get_bloginfo('template_directory') . '/images/default_avatar.png';
}
add_filter( 'pre_option_avatar_default', '__default_local_avatar' );
//to be continued...
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment