• I have my own custom smilies. I want to change the directory where WordPress finds the smilies to a directory in my theme files using my theme’s functions.php template.

    I have located the function in the core files where WordPress finds the function

    function translate_smiley($smiley) {
    	global $wpsmiliestrans;
    
    	if (count($smiley) == 0) {
    		return '';
    	}
    
    	$siteurl = get_option( 'siteurl' );
    
    	$smiley = trim(reset($smiley));
    	$img = $wpsmiliestrans[$smiley];
    	$smiley_masked = esc_attr($smiley);
    
    	$srcurl = apply_filters('smilies_src', "$siteurl/wp-includes/images/smilies/$img", $img, $siteurl);
    
    	return " <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> ";
    }

    So far all of my attempts at rudimentary custom theme function writing have failed. Any suggestions would be appreciated.

    Adam

  • The topic ‘Change smilies to custom theme directory’ is closed to new replies.