[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/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

  wpEmoji()
  browserSupportsSvgAsImage()
  load()
  test()
  parse()

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
returned.

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: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7