-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove-emojis-slugs.php
More file actions
40 lines (35 loc) · 1.54 KB
/
remove-emojis-slugs.php
File metadata and controls
40 lines (35 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Plugin Name: Remove emojis from slugs
* Description: Strips emoji and related pictographic symbols from sanitized slugs so post URLs stay ASCII-only (post titles are unchanged).
* Version: 1.0.0
* Author: Be API
* Author URI: https://beapi.fr
* License: GPL-3.0-or-later
* License URI: https://github.com/BeAPI/remove-emojis-slugs/blob/master/LICENSE.md
* Requires at least: 1.2
* Requires PHP: 7.4
* Text Domain: remove-emojis-slugs
* @package BEAPI\Remove_Emojis_Slugs
*
* Copyright 2018-2026 Be API Technical team (human@beapi.fr)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
namespace BEAPI\Remove_Emojis_Slugs;
// Standard plugin security, keep this line in place.
defined( 'ABSPATH' ) || die();
define( 'BEAPI_REMOVE_EMOJIS_SLUGS_DIR', __DIR__ );
require_once BEAPI_REMOVE_EMOJIS_SLUGS_DIR . '/includes/emoji-removal.php';
add_filter( 'sanitize_title', __NAMESPACE__ . '\\remove_emojis_from_sanitized_slug', 1, 3 );