Advertisements

translate_smiley

Definition:
function translate_smiley($smiley) {}

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.

Parameters

  • string $smiley: Smiley code to convert to image.

Return values

returns:Image string for smiley.

Defined filters

  • smilies_src
    apply_filters('smilies_src', includes_url("images/smilies/$img")

Source code

function translate_smiley($smiley) {

	global $wpsmiliestrans;



	if (count($smiley) == 0) {

		return '';

	}



	$smiley = trim(reset($smiley));

	$img = $wpsmiliestrans[$smiley];

	$smiley_masked = esc_attr($smiley);



	$srcurl = apply_filters('smilies_src', includes_url("images/smilies/$img"), $img, site_url());



	return " <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> ";

}

3085

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: