Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
noblogs-wp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
39
Issues
39
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ai
noblogs-wp
Commits
264d0fb8
Commit
264d0fb8
authored
Jan 14, 2017
by
lucha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable emojis plugin
parent
3c8e48c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
wp-content/mu-plugins/disable-emojis.php
wp-content/mu-plugins/disable-emojis.php
+77
-0
No files found.
wp-content/mu-plugins/disable-emojis.php
0 → 100644
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment