WordPress教程 · WPtech

WordPress禁用加载Emoji表情

小编 · 7月9日 · 2020年 ·

WordPress 前台頁面會自動加載Emoji表情,這可能會導致有些網站的自定義表情錯誤,如何禁用WordPress加載Emoji表情?下面讓我一起來學習如何將禁用WordPress 加載Emoji表情吧。

WordPress禁用加载Emoji表情

在functions.php加入以下代碼:

/*
禁用 WordPress 加载 Emoji 表情
https://www.zsxcool.com/
*/
remove_action( 'admin_print_scripts' , 'print_emoji_detection_script');
remove_action( 'admin_print_styles' , 'print_emoji_styles');
remove_action( 'wp_head' , 'print_emoji_detection_script', 7);
remove_action( 'wp_print_styles' , 'print_emoji_styles');
remove_filter( 'the_content_feed' , 'wp_staticize_emoji');
remove_filter( 'comment_text_rss' , 'wp_staticize_emoji');
remove_filter( 'wp_mail' , 'wp_staticize_emoji_for_email');

WordPress禁用加载Emoji表情,会优化前端加载速度,如何没有使用Emoji表情的必要,还是禁用了吧~

0 条回应