Advertisement
Guest User

Untitled

a guest
Apr 11th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. /**
  2. * Disable the emoji's
  3. */
  4. function disable_emojis() {
  5. remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  6. remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  7. remove_action( 'wp_print_styles', 'print_emoji_styles' );
  8. remove_action( 'admin_print_styles', 'print_emoji_styles' );
  9. remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  10. remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
  11. remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
  12. add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
  13. add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
  14. }
  15. add_action( 'init', 'disable_emojis' );
  16.  
  17. /**
  18. * Filter function used to remove the tinymce emoji plugin.
  19. *
  20. * @param array $plugins
  21. * @return array Difference betwen the two arrays
  22. */
  23. function disable_emojis_tinymce( $plugins ) {
  24. if ( is_array( $plugins ) ) {
  25. return array_diff( $plugins, array( 'wpemoji' ) );
  26. } else {
  27. return array();
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement