mbis

Remove Emoji from WordPress slugs

Sep 28th, 2020 (edited)
1,149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function pm_remove_emojis_from_slugs($str) {
  2.     return preg_replace('/-{0,}%f0%9f%[\w]{2}%[\w]{2}-{0,}/', '', $str);
  3. }
  4. add_filter('wp_unique_post_slug', 'pm_remove_emojis_from_slugs', 1);
RAW Paste Data