You are familiar with modifying the default Wordpress emoticon to a custom emoticon. You should have heard of additional emoticon. (You can search for wordpress on this site to find a solution that does not recognize custom emoticon ), I have read about how to add extra emotices on the Internet. In addition to installing the customssmilies plug-in, there is only one left to modify functions in wp-javasdes. This
You are familiar with modifying the default Wordpress emojis to custom emojis, you should have heard of adding additional expressions (you can search for "wordpress's solution to adding a custom expression that is not recognized" on this site). I have read it, in addition to installing the customs smilies plug-in, the method for adding extra emotices on the Internet only involves modifying functions by using wp-javasdes. This
You are familiar with modifying the default Wordpress emojis to custom emojis, you should have heard of adding additional expressions (you can search for "wordpress's solution to adding a custom expression that is not recognized" on this site). I have read it, in addition to installing the customs smilies plug-in, the method for adding extra emotices on the Internet only involves modifying functions with wp-uplodes. This method is of course not good because wordpress is updated, you have to change the function again. Next I will introduce you to the topic functions. add a function in php to add an emoticon. The benefits of doing so are the same as modifying the emoticon image folder.
First, let's look at the principle. (If you don't know the principle, this article is not long enough.) Search for smiley in wp-shortdes → functions. php.smilies_init
This function,
Function smilies_init () {global $ wpsmiliestrans, $ wp_smiliessearch; // don't bother setting up smilies if they are disabledif (! Get_option ('use _ smilies ') return; if (! Isset ($ wpsmiliestrans) {$ wpsmiliestrans = array (': mrgreen:' => 'icon_mrgreen.gif ',': neutral: '=> 'icon_neutral.gif ',//.... one thousand words are omitted here...
From this we can see that the $ wpsmiliestrans array defines the output of the expression,
So next we need to add the following code to the topic's functions. php to redefine the array.
Global $ wpsmiliestrans; $ wpsmiliestrans = array (': new:' => 'new.gif ',': new1: '=> 'new1.gif', ': new2:' => 'new2.gif ', ': new3:' => 'new3.gif ',': new4: '=> 'new4.gif', // and so on ...);
Okay, that's all. I'm not afraid of wordpress updates in the future. My husband is in Tianjin today and will not accompany you in the evening.
Original article address: add the function of the extra emoticon directly in the theme template function. Thank you for sharing it with the original author.