Skip to:
Content

BuddyPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#6529 closed enhancement (fixed)

Support emojis

Reported by: r-a-y Owned by: r-a-y
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.3.0
Component: Core Keywords: has-patch
Cc:

Description

WP 4.2 added support for emojis.

However, there is a bug report on the forums saying that adding emojis to an activity update causes an error when posting:
https://buddypress.org/support/topic/wp-does-emoji-bp-does-not/

I haven't looked into this report yet, so I'm leaving this in the "Awaiting Review" milestone for now.

Attachments (4)

6529.01.patch (711 bytes) - added by r-a-y 4 years ago.
6529.02.patch (2.2 KB) - added by r-a-y 4 years ago.
6529.03.patch (2.3 KB) - added by r-a-y 4 years ago.
Switches out WP version check for function check.
Capture d’écran 2016-02-08 à 23.16.30.png (30.9 KB) - added by imath 4 years ago.
How come using 3 emojis fails in WP 3.9 ?

Download all attachments as: .zip

Change History (16)

#1 @DJPaul
4 years ago

Don't really think it's a bug, it's not supported yet in BP: #6346

#2 @r-a-y
4 years ago

  • Milestone Awaiting Review deleted
  • Status changed from new to closed
  • Type changed from defect (bug) to enhancement

Sorry, didn't mean to mark this ticket as a bug!

After looking into the emoji spec, we should get this for free after #6346 is addressed.

Marking as a duplicate.

#3 @r-a-y
4 years ago

  • Keywords dev-feedback added
  • Milestone set to 2.5

So I came across a WP function that converts emojis over to HTML encoding.

We should be able to easily support emojis with this:

add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' );

wp_encode_emoji() only supports Unicode 7 emojis though, but that's better than nothing! The function is only supported in WP 4.2+, so if we add this to the codebase, we'd have to do a conditional on the WP version.

For now, I'm adding this back to the 2.5 milestone for some feedback.

#4 @r-a-y
4 years ago

  • Status changed from closed to reopened

@r-a-y
4 years ago

#5 @r-a-y
4 years ago

  • Keywords has-patch added; needs-testing dev-feedback removed

I think this one is an easy win!

Tested with WP 4.4 and a copy-and-pasted emoji, as well as with WP 3.8 to ensure no notices appear.

#6 @imath
4 years ago

Nice !

#7 @DJPaul
4 years ago

So... I thought we needed to migrate the tables to utf8mb4. What does that not do if we need to do this for emojis?

#8 @r-a-y
4 years ago

So... I thought we needed to migrate the tables to utf8mb4. What does that not do if we need to do this for emojis?

See comment:3.

According to the Docblock, wp_encode_emoji() only supports Unicode-7 emojis. The good news is there are only 37 Unicode-8 emojis:
http://emojipedia.org/unicode-8.0/

However, I did a test of a few Unicode-8 emojis and wp_encode_emoji() worked for these as well.

I assume the DB upgrade will support all other emojis from Unicode-8.

Last edited 4 years ago by r-a-y (previous) (diff)

@r-a-y
4 years ago

#9 @r-a-y
4 years ago

Patch refreshed and now also supports private messages and group descriptions.

I didn't add xprofile support because it could affect display names, so I left that alone.

@r-a-y
4 years ago

Switches out WP version check for function check.

This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.


4 years ago

@imath
4 years ago

How come using 3 emojis fails in WP 3.9 ?

#11 @r-a-y
4 years ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from reopened to closed

In 10572:

Support emojis for those using WordPress 4.2+.

WordPress introduced a function in WP 4.2 to encode emojis,
wp_encode_emoji().

We're using this function to encode emojis in activity streams, private
messages and group descriptions.

🍕

Fixes #6529.

#12 @DJPaul
3 years ago

  • Component changed from Component - Any/All to Core
Note: See TracTickets for help on using tickets.