convert_smilies()
Replaces textual smilies in the text with the corresponding smilie images.
The function works only if the "use smilies" option is enabled and the global variables (arrays) ($wp_smiliessearch, $wp_smiliesreplace) with smilies are not empty.
No Hooks.
Returns
String. formatted text.
Usage
<?php convert_smilies( $text ) ?>
- $text(string) (required)
- Text in which to convert smilies.
Examples
#1 Displays text with converted smilies
$text = "Text with emoticons :) :(";
echo convert_smilies( $text );
// output:
// Text with emoticons <img src='/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
// <img src='/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />
Notes
- Global. String|Array.
$wp_smiliessearch
Changelog
| Since 0.71 | Introduced. |