Thread Starter
xmifox
(@xmifox)
Am I the only one who has this problem? Would be nice to get it confirmed and possible some help or advice on what I need to do to fix this.
Same here.
Found a code snipped but i have no idea where to place it…
function removeEmoji($text) {
$clean_text = "";
// Match Emoticons
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
$clean_text = preg_replace($regexEmoticons, '', $text);
// Match Miscellaneous Symbols and Pictographs
$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u';
$clean_text = preg_replace($regexSymbols, '', $clean_text);
// Match Transport And Map Symbols
$regexTransport = '/[\x{1F680}-\x{1F6FF}]/u';
$clean_text = preg_replace($regexTransport, '', $clean_text);
return $clean_text;
}
Sorry for your issue. There is no perfect solution for handling emojis and I haven’t had time to work on an improvement. Based on Klausie’s reply, you could try:
function removeEmoji( $content ) {
$clean_text = "";
// Match Emoticons
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
$clean_text = preg_replace($regexEmoticons, '', $text);
// Match Miscellaneous Symbols and Pictographs
$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u';
$clean_text = preg_replace($regexSymbols, '', $clean_text);
// Match Transport And Map Symbols
$regexTransport = '/[\x{1F680}-\x{1F6FF}]/u';
$clean_text = preg_replace($regexTransport, '', $clean_text);
return $clean_text;
}
add_filter( 'dsgnwrks_instagram_post_content', 'removeEmoji' );
But standard disclaimer: I have never used his snippet, so have no idea how/if it works.
I had the wrong variable at the top. should be:
function removeEmoji( $text ) {
$clean_text = "";
// Match Emoticons
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
$clean_text = preg_replace($regexEmoticons, '', $text);
// Match Miscellaneous Symbols and Pictographs
$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u';
$clean_text = preg_replace($regexSymbols, '', $clean_text);
// Match Transport And Map Symbols
$regexTransport = '/[\x{1F680}-\x{1F6FF}]/u';
$clean_text = preg_replace($regexTransport, '', $clean_text);
return $clean_text;
}
add_filter( 'dsgnwrks_instagram_post_content', 'removeEmoji' );
Thread Starter
xmifox
(@xmifox)
For me to! Great. Big thanks!