SHOW:
|
|
- or go back to the newest paste.
1 | - | function pm_remove_emojis($regex) { |
1 | + | function pm_remove_emojis_from_slugs($str) { |
2 | - | $regex = str_replace('[^', '(%f0%9f%[\w]{2}%[\w]{2}|[^', $regex); |
2 | + | return preg_replace('/-{0,}%f0%9f%[\w]{2}%[\w]{2}-{0,}/', '', $str); |
3 | - | $regex = str_replace(']/ui', '])/ui', $regex); |
3 | + | |
4 | - | |
4 | + | add_filter('wp_unique_post_slug', 'pm_remove_emojis_from_slugs', 1); |