[ Index ]

WordPress 5.4.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    




/wp-includes/js/ -> wp-emoji.js (summary)

wp-emoji.js is used to replace emoji with images in browsers when the browser doesn't support emoji natively.

File Size: 302 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 5 functions


Functions that are not part of a class:

wpEmoji()   X-Ref
Replaces emoji with images when browsers don't support emoji.

return: {Object} The wpEmoji parse and test functions.

browserSupportsSvgAsImage()   X-Ref
Detect if the browser supports SVG.

return: {boolean} True if the browser supports svg, false if not.

load()   X-Ref
Runs when the document load event is fired, so we can do our first parse of
the page.

Listens to all the DOM mutations and checks for added nodes that contain
emoji characters and replaces those with twitter emoji images.

test( text )   X-Ref
Tests if a text string contains emoji characters.

param: {string} text The string to test.
return: {boolean} Whether the string contains emoji characters.

parse( object, args )   X-Ref
Parses any emoji characters into Twemoji images.

- When passed an element the emoji characters are replaced inline.
- When passed a string the emoji characters are replaced and the result is

param: {HTMLElement|string} object The element or string to parse.
param: {Object}             args   Additional options for Twemoji.
return: {HTMLElement|string} A string where all emoji are now image tags of

Generated: Tue May 19 15:51:04 2020 Cross-referenced by PHPXref 0.7.1