我正在从wp_comments
表格中获取评论,但是当在浏览器上显示它时,它不会显示表情符号而是显示:)
,:D
尽管评论有一些表情符号。我阅读了使用表情符号,现在我想创建自定义功能,:)
用适当的图标替换等等。
但我不知道怎么做?
本页描述了表情符号/笑脸作为图形的使用:
http://codex.wordpress.org/Using_Smilies
如果您正在寻找转换表情符号的 wp 脚本,请看这里:
httpdocs/wp-includes/formatting.php
〜线:1715
/**
* Convert one smiley code to the icon graphic file equivalent.
*
* Looks up one smiley code in the $wpsmiliestrans global array and returns an
* <img> string for that smiley.
*
* @global array $wpsmiliestrans
* @since 2.8.0
*
* @param string $smiley Smiley code to convert to image.
* @return string Image string for smiley.
*/
function translate_smiley($smiley) {
...
/**
* Convert text equivalent of smilies to images.
*
* Will only convert smilies if the option 'use_smilies' is true and the global
* used in the function isn't empty.
*
* @since 0.71
* @uses $wp_smiliessearch
*
* @param string $text Content to convert smilies from text.
* @return string Converted content with text smilies replaced with images.
*/
function convert_smilies($text) {