Support » Fixing WordPress » Emoji and smiley js and css added to head

  • Resolved semrocc

    (@semrocc)


    When updating WordPress to 4.2, there is a bunch of JS and CSS added to the head:

    <script type="text/javascript">
    			window._wpemojiSettings = {"baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/www.mysite.com\/wp\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.2"}};
    			!function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f;c.supports={simple:d("simple"),flag:d("flag")},c.supports.simple&&c.supports.flag||(f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
    		</script>
    		<style type="text/css">
    img.wp-smiley,
    img.emoji {
    	display: inline !important;
    	border: none !important;
    	box-shadow: none !important;
    	height: 1em !important;
    	width: 1em !important;
    	margin: 0 .07em !important;
    	vertical-align: -0.1em !important;
    	background: none !important;
    	padding: 0 !important;
    }
    </style>
Viewing 15 replies - 1 through 15 (of 52 total)
  • Moderator Marius L. J.

    (@clorith)


    Hi,

    That is correct, this is code related to the new Emoji support in 4.2 (See http://codex.wordpress.org/Emoji)

    If you don’t want this here you can remove Emoji support by using a plugin, for example https://wordpress.org/plugins/disable-emojis/

    Thanks for the info Marius.

    Hard to believe that this is a core item and cannot be removed via the admin…hope they have an admin option in the future.

    Also you can put this code on your functions.php

    remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 );
    remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ );

    I love doing updates.. LOL!

    Just updated and my smiles are all messed up. In Google chrome wink is displayed as a black x.

    Will doing either kill the old style emoticons along with the new emoji stuff? Ehh.. suppose I can just add it and find out. Looks like the two remove_action statements above do remove the extra emoji stuff but the old style emoticons still work.

    @apocalypseboy.com

    Thanks for the tip, seems to do the trick.

    I’m sure there’s thousands if not millions of business type sites that do not use or want to use emoji’s etc. To me it would make more sense to create a plugin for people that want to use emoji’s, instead of the other way around.

    Thanks apocalypseboy.com, Tried the snippets on my blog but no change. I run under CloudFlare so the new smilies might be cached in. Will fiddle with it tomorrow.

    I agree with Semrocc. Make it an option. Or better yet add it to JetPack.

    The support for emoji also allows us to natively support kanji and other complex character sets. So while emoji is what a lot of native English speakers ‘see’ as the big thing, it’s really not.

    Emoji, like smilies, are something best left ‘on’ because more people will use them than you think.

    You don’t have to put them in your posts after all.

    https://wordpress.org/plugins/disable-emojis/

    I have been using smilie shortcuts for years in posts. 😉 etc. Now after 4,2 they are different and some do not display at all in Google Chrome. I get big black x.

    I assume this is because of this new emoji support. I have enough plugins now, would rather not add another.

    Well, If I never use them in my posts then it makes no sense to load the extra JS and CSS for them. Anyway, whatever floats your boat.

    Have the smiley short-codes changed with 4.2? I went to CloudFlare and dumped my cache and still have distorted off color smileys or no smileys at all.

    On my blogs home page these two winks used to be yellow. Now the shape and color has changed.

    Don’t make sense to change something that will alter or break previous inserted smilies via shortcode 😉 😆 etc.

    Hi folks,

    Since the new wordpress 4.2 update, I can see a class added but also a style added on every smiley

    such as
    <img src=”http://www.domain.com/wp-content/smilies/smiley.gif” alt=”:smiley:” class=”wp-smiley” style=”height: 1em; max-height: 1em;“>

    So I can not overide that in CSS and my smiley looks ridiculously small. Any guess how to get rid of that ?

    It’s quite a pain to waste time fixing something that was not broken before T_T

    Thanks in advance for any help.

    For the first time in several years I had to roll back a new version of WordPress to the old one. The Reason Is Emoji. What was the need to implement this for all users by default? That’s a pretty specific function! I want the old smilies!

    Give the opportunity to choose to use emoticons or Emoji. After updating all my emoticons partially replaced by Emoji, partially instead of black squares that looks terrible!

    Previously, I have added all the smilies under the comment form that commentators would put them in the form of a comment, now it will not start! Still the file names in the path to the images are broken, replacing the file name in Emoji and a link causes a 404 error. Do something, it looks bad.

    I suggest to remove Emoji from the core of WordPress and add them as a plugin, for example in a Jetpack.

    The old saying “fix something that’s not broken” comes to mind here!

    I really feel like you should be able to disable / enable this functionality via the Settings -> Writing screen. I don’t use emoji and don’t want random blocks of JS in the header of my websites.

    +1 for the remove_action, just seems really unnecessary.

Viewing 15 replies - 1 through 15 (of 52 total)
  • The topic ‘Emoji and smiley js and css added to head’ is closed to new replies.