Uses
Uses | Description |
---|---|
wp-includes/formatting.php: _wp_emoji_list() | Returns arrays of emoji data. |
Convert emoji characters to their equivalent HTML entity.
This allows us to store emoji in a DB using the utf8 character set.
(string) (Required) The content to encode.
(string) The encoded content.
File: wp-includes/formatting.php
function wp_encode_emoji( $content ) { $emoji = _wp_emoji_list( 'partials' ); foreach ( $emoji as $emojum ) { $emoji_char = html_entity_decode( $emojum ); if ( false !== strpos( $content, $emoji_char ) ) { $content = preg_replace( "/$emoji_char/", $emojum, $content ); } } return $content; }
Version | Description |
---|---|
4.2.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_encode_emoji