Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
noblogs-wp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
noblogs-wp
Commits
264d0fb8
Commit
264d0fb8
authored
8 years ago
by
lucha
Browse files
Options
Downloads
Patches
Plain Diff
disable emojis plugin
parent
3c8e48c5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wp-content/mu-plugins/disable-emojis.php
+77
-0
77 additions, 0 deletions
wp-content/mu-plugins/disable-emojis.php
with
77 additions
and
0 deletions
wp-content/mu-plugins/disable-emojis.php
0 → 100644
+
77
−
0
View file @
264d0fb8
<?php
/*
Plugin Name: Disable Emojis
Plugin URI: https://geek.hellyer.kiwi/plugins/disable-emojis/
Description: Disable Emojis
Version: 1.5.3
Author: Ryan Hellyer
Author URI: https://geek.hellyer.kiwi/
License: GPL2
------------------------------------------------------------------------
Copyright Ryan Hellyer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* Disable the emoji's
*/
function
disable_emojis
()
{
remove_action
(
'wp_head'
,
'print_emoji_detection_script'
,
7
);
remove_action
(
'admin_print_scripts'
,
'print_emoji_detection_script'
);
remove_action
(
'wp_print_styles'
,
'print_emoji_styles'
);
remove_action
(
'admin_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'
);
add_filter
(
'tiny_mce_plugins'
,
'disable_emojis_tinymce'
);
add_filter
(
'wp_resource_hints'
,
'disable_emojis_remove_dns_prefetch'
,
10
,
2
);
}
add_action
(
'init'
,
'disable_emojis'
);
/**
* Filter function used to remove the tinymce emoji plugin.
*
* @param array $plugins
* @return array Difference betwen the two arrays
*/
function
disable_emojis_tinymce
(
$plugins
)
{
if
(
is_array
(
$plugins
)
)
{
return
array_diff
(
$plugins
,
array
(
'wpemoji'
)
);
}
else
{
return
array
();
}
}
/**
* Remove emoji CDN hostname from DNS prefetching hints.
*
* @param array $urls URLs to print for resource hints.
* @param string $relation_type The relation type the URLs are printed for.
* @return array Difference betwen the two arrays.
*/
function
disable_emojis_remove_dns_prefetch
(
$urls
,
$relation_type
)
{
if
(
'dns-prefetch'
==
$relation_type
)
{
/** This filter is documented in wp-includes/formatting.php */
$emoji_svg_url
=
apply_filters
(
'emoji_svg_url'
,
'https://s.w.org/images/core/emoji/2.2.1/svg/'
);
$urls
=
array_diff
(
$urls
,
array
(
$emoji_svg_url
)
);
}
return
$urls
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment