-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
30 lines (25 loc) · 833 Bytes
/
index.php
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
<?php
/*
* Plugin Name: KGR ELOT 743
* Plugin URI: https://github.com/constracti/kgr-elot-743
* Description: Convert greek titles to greeklish slugs according to ELOT 743.
* Version: 1.1
* Requires at least: 2.8.0
* Requires PHP: 7.0
* Author: constracti
* Author URI: https://github.com/constracti
* Licence: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
if ( !defined( 'ABSPATH' ) )
exit;
define( 'KGR_ELOT_743_DIR', plugin_dir_path( __FILE__ ) );
define( 'KGR_ELOT_743_URL', plugin_dir_url( __FILE__ ) );
require_once( KGR_ELOT_743_DIR . 'elot743.php' );
add_filter( 'sanitize_title', function( string $title, string $raw_title, string $context ): string {
if ( $context === 'save' ) {
$title = kgr_elot_743( $raw_title );
$title = remove_accents( $title );
}
return $title;
}, 5, 3 );