Support » Plugin: Gwolle Guestbook » Add cumstom emojis

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Marcel Pol

    (@mpol)

    Hi, in version 2.2.0 it is not.
    In version 2.3.0, the next, that is currently in trunk/development it is.

    If you want to use that, you can find it on the Advanced View.

    There is example code included, it looks like this:

    
    function my_gwolle_gb_get_emoji( $emoji ) {
    	// $emoji is a string.
    
    	// Add a character.
    	$emoji .= '<a title="✌️" class="gwolle_gb_emoji_50 noslimstat">✌️</a>';
    
    	// Replace a character.
    	$old = '<a title="🏝" class="gwolle_gb_emoji_65 noslimstat">🏝</a>g';
    	$new = '<a title="✌️" class="gwolle_gb_emoji_50 noslimstat">✌️</a>';
    	$emoji = str_replace( $old, $new, $emoji );
    
    	return $emoji;
    }
    add_filter( 'gwolle_gb_get_emoji', 'my_gwolle_gb_get_emoji', 10, 1 );
    Thread Starter TryAllTheThings

    (@roots84)

    Thanks for adding this!
    It’s not clear to me how to add an custom image (.png for example) as an emoji now. Could you please elaborate?

    Thanks,
    Stefan

    Plugin Author Marcel Pol

    (@mpol)

    You can take a look at:
    https://emojikeyboard.org/
    There you can select an emoji character. (which is not the same as a png file).
    There are other sites where you can pick and choose them.

    Take a look at the file functions/gb-bbcode_emoji.php and cut and paste just any line from the function ‘gwolle_gb_get_emoji’ to your own function below.

    Then use this function in your functions.php of your theme:

    function my_gwolle_gb_get_emoji( $emoji ) {
    	// Add a character.
    	$emoji .= '<a title="my pasted character" class="gwolle_gb_emoji_66 noslimstat">my pasted character</a>';
    	return $emoji;
    }
    add_filter( 'gwolle_gb_get_emoji', 'my_gwolle_gb_get_emoji', 10, 1 );

    where you replace the text ‘my pasted character’ with the emoji character that you want.

    Does this help?

    Thread Starter TryAllTheThings

    (@roots84)

    This kinda helps. If I get you right I can only use Emojis from that website but nut use my own image file?

    Plugin Author Marcel Pol

    (@mpol)

    Emoji are really characters, like a, b and c and so on.
    There are many emoji, more than on that website.

    The functionality here is not really aimed at custom images, sorry.

    Thread Starter TryAllTheThings

    (@roots84)

    Thanks for the clarification. Do you have any plans to implement custom images at this point? Otherwise I might implement it myself.

    Plugin Author Marcel Pol

    (@mpol)

    I have no plans for custom images.
    You might be able to integrate them as BBcode buttons.
    If you need anything for that, like filters, let me know. Currently that part is quite static code without any filters.
    They could just be like the image button, but with predefined urls.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add cumstom emojis’ is closed to new replies.