wp_encode_emoji() - WordPress 函数参考中文文档

返回介绍

wp_encode_emoji()

发布于 2017-09-11 字数 1427 浏览 850 评论 0

wp_encode_emoji( string $content )

Convert any 4 byte emoji in a string to their equivalent HTML entity.


描述

Currently, only Unicode 7 emoji are supported. Skin tone modifiers are allowed, all other Unicode 8 emoji will be added when the spec is finalised.

This allows us to store emoji in a DB using the utf8 character set.


参数

$content

(string)
(Required)
The content to encode.


返回值

(string) The encoded content.


源代码

File: wp-includes/formatting.php

function wp_encode_emoji( $content ) {
	if ( function_exists( 'mb_convert_encoding' ) ) {
		$regex = '/(
		     \x23\xE2\x83\xA3              

更新日志

Version 描述
4.2.0 Introduced.

相关函数

Used By

  • wp-includes/formatting.php:
    wp_staticize_emoji()
  • wp-includes/formatting.php:
    sanitize_option()
  • wp-includes/post.php:
    wp_insert_post()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!