Guest User

Untitled

a guest
Jun 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. function disable_wp_emoji() {
  4.  
  5. // all actions related to emojis
  6. remove_action( 'admin_print_styles', 'print_emoji_styles' );
  7. remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  8. remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  9. remove_action( 'wp_print_styles', 'print_emoji_styles' );
  10. remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
  11. remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  12. remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
  13.  
  14. // filter to remove TinyMCE emojis
  15. add_filter( 'tiny_mce_plugins', 'disable_emoji_tinymce' );
  16. }
  17. add_action( 'init', 'disable_wp_emoji' );
  18.  
  19. function disable_emoji_tinymce( $plugins ) {
  20. if ( is_array( $plugins ) ) {
  21. return array_diff( $plugins, array( 'wpemoji' ) );
  22. } else {
  23. return array();
  24. }
  25. }
Add Comment
Please, Sign In to add comment