Advertisement
Guest User

Untitled

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