Hi there,
thanks for contacting us and I hope you’re doing well!
We have a code to avoid taking into account emojis added to the textarea. You can use it by adding it in the functions.php file of your active theme:
if ( ! function_exists( 'ywgc_message_cart_item_data_remove_emojis' ) ) {
function ywgc_message_cart_item_data_remove_emojis( $message ) {
// Match Enclosed Alphanumeric Supplement
$regex_alphanumeric = '/[\x{1F100}-\x{1F1FF}]/u';
$clear_string = preg_replace($regex_alphanumeric, '', $message);
// Match Miscellaneous Symbols and Pictographs
$regex_symbols = '/[\x{1F300}-\x{1F5FF}]/u';
$clear_string = preg_replace($regex_symbols, '', $clear_string);
// Match Emoticons
$regex_emoticons = '/[\x{1F600}-\x{1F64F}]/u';
$clear_string = preg_replace($regex_emoticons, '', $clear_string);
// Match Transport And Map Symbols
$regex_transport = '/[\x{1F680}-\x{1F6FF}]/u';
$clear_string = preg_replace($regex_transport, '', $clear_string);
// Match Supplemental Symbols and Pictographs
$regex_supplemental = '/[\x{1F900}-\x{1F9FF}]/u';
$clear_string = preg_replace($regex_supplemental, '', $clear_string);
// Match Miscellaneous Symbols
$regex_misc = '/[\x{2600}-\x{26FF}]/u';
$clear_string = preg_replace($regex_misc, '', $clear_string);
// Match Dingbats
$regex_dingbats = '/[\x{2700}-\x{27BF}]/u';
$message = preg_replace($regex_dingbats, '', $clear_string);
return $message;
}
add_filter( 'ywgc_message_cart_item_data', 'ywgc_message_cart_item_data_remove_emojis', 99 );
}
Check it out and tell us if it works well for you, please.
Best regards.