convert_smilies [ WordPress Function ]
convert_smilies ( $text )
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: convert_chars, convert_to_screen, count_users, comment_id_fields, comment_form_title
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.
Source
<?php
function convert_smilies($text) {
global $wp_smiliessearch;
$output = '';
if ( get_option('use_smilies') && !empty($wp_smiliessearch) ) {
// HTML loop taken from texturize function, could possible be consolidated
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
$stop = count($textarr);// loop stuff
for ($i = 0; $i < $stop; $i++) {
$content = $textarr[$i];
if ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag
$content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content);
}
$output .= $content;
}
} else {
// return default text.
$output = $text;
}
return $output;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/convert smilies « WordPress Codex
Convert text equivalent of smilies to images. Will only convert smilies if the option 'use_smilies' is true and the globals used in the function aren't empty.
codex.wordpress.org - WordPress › Support » better convert_smilies routine?
I was wondering if anyone has already attempted to make better convert_smilies code before I dive into it (in formatting.php for v2.1) WP's current code is rather ...
wordpress.org - Error with preg_replace() in formatting.php > convert_smilies()
After upgrading to version 2.1.2 from 2.1.1 my post text was gone and an error from preg_replace() on line 647 appeared complaining about an empty regular ...
wordpress.org - bp_get_activity_parent_content - etivite
add_filter( 'bp_get_activity_parent_content', 'convert_smilies' ) ... 'wptexturize' ); add_filter( 'bp_get_activity_action', 'convert_smilies' ); add_filter( ...
etivite.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- gnawph on "Error with preg_replace() in formatting.php > convert_smilies()"
- tsaylor on "Error with preg_replace() in formatting.php > convert_smilies()"
- _ck_ on "better convert_smilies routine?"
- Les Bessant on "better convert_smilies routine?"
- _ck_ on "better convert_smilies routine?"
- Otto on "better convert_smilies routine?"
- _ck_ on "better convert_smilies routine?"