AI Verified

Name

Disable Emojis

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

Standards

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: Not Specified

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

10/10/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Disable Emojis

 
                    
1/**
2 * Disable the emojis in WordPress.
3 */
4add_action( 'init', function () {
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 
13 // Remove from TinyMCE.
14 add_filter( 'tiny_mce_plugins', function ( $plugins ) {
15 if ( is_array( $plugins ) ) {
16 return array_diff( $plugins, array( 'wpemoji' ) );
17 } else {
18 return array();
19 }
20 } );
21 
22 // Remove from dns-prefetch.
23 add_filter( 'wp_resource_hints', function ( $urls, $relation_type ) {
24 if ( 'dns-prefetch' === $relation_type ) {
25 $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/' );
26 $urls = array_diff( $urls, array( $emoji_svg_url ) );
27 }
28 
29 return $urls;
30 }, 10, 2 );
31} );

0

Related Snippets

Please see some snippets below related to this snippet..

General

Unverified

0

ticketReservation

Added: 2 months ago

Last Updated: 2 months ago

General

Unverified

0

dropDownDatabaseColorSurvey

Added: 2 months ago

Last Updated: 2 months ago

Black White Gray Brown Pink Cyan

General

Unverified

0

Google tags header

Added: 7 months ago

Last Updated: 7 months ago

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

General

AI Verified

1

Hide Login Errors in WordPress

Added: 8 months ago

Last Updated: 1 day ago

General

AI Verified

1

Remove Dashboard Welcome Panel

Added: 8 months ago

Last Updated: 1 day ago

Hide the Welcome Panel on the WordPress dashboard for all users.

General

AI Verified

0

Enable Shortcode Execution in Text Widgets

Added: 8 months ago

Last Updated: 8 months ago

Extend the default Text Widget with shortcode execution.