In WordPres 4.2+ it’s possible to use emoji inside the post content editor. However, I can’t use emoji in ACF fields including WYSIWYG editor with full features. If I save the field, all the field content is automatically removed.
Is it possible to give emoji compatibility to your fields?
When you say that all the field content is removed do you mean that your emojis are removed or that if you’ve pasted in a block of text in the wysiwyg-field and save it the whole thing gets removed leaving you with an empty editor?
If so, does the same thing happen if you paste in text NOT containing any emojis?
Okay so I’ve tried it now on a WYSIWYG field.. I tested the car emoji ? 🙂
It works just fine for me.. the content is saved regardless of how I place the emoji. Could you try disabling all other plugins and test it again? And perhaps try it with the default twentyfifteen theme. Just to eliminate any outside interference
Do you have wp_debug on?
If not please activate it and see if it turns up any notices/warnings/errors..
Here’s a snippet I like to place in my wo-config file which’ll save all issues to a debug.log file in wp-content rather than spit them out directly on the screen.
// Turns WordPress debugging on
// Tells WordPress to log everything to the /wp-content/debug.log file
// Doesn't force the PHP 'display_errors' variable to be on
// Hides errors from being displayed on-screen
Perhaps it’s an issue of your database. Do you have the latest WP version? Also, does the same thing happen when you place emojis in the standard editor?
What’s interesting here is that ACFs wywisyg-field just makes use of the wp_editor in WP core so it does pretty much the same things as the default editor.
I know I’m almost three years late to the party, but I was running into the same issue and couldn’t find a solution.
I tried inserting an emoji directly in the database, which prompted an error. After researching that error, it seems the field’s collation type didn’t support all emoji (but some, like 3-byte ones would work). In my case, it was set to
Solution: Change the field collation type to
utf8mb4_general_ci to support longer-byte emoji.
To be on the safe side, make a backup of your database before operating this change. Hope this helps other people that run into this issue! 🙂
@chriskirknielsen Thanks! It works.
More details for next people:
I’ve just come across the same problem. Changing the database column to ut8mb4 does seem to work, but we shouldn’t have to need to do this and risk messing up all the rest of the content.
There’s a solution here to get it working without needing to update the column format. Would it be possible to implement this directly into acf?
The topic ‘Emoji removed from custom fields’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!