我正在从wp_comments
表格收到评论,但是当它在浏览器上显示时,它不会显示表情符号而是显示:)
和:D
,尽管评论有一些表情符号。我看了Using Smilies,现在我想创建自定义函数,用适当的图标替换:)
等等。
但我不知道怎么做?
答案 0 :(得分:2)
此页面描述了使用表情符号/表情符号作为图形:
http://codex.wordpress.org/Using_Smilies
如果您正在寻找转换表情符号的wp脚本,请点击此处:
httpdocs/wp-includes/formatting.php
~line: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) {