-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdonden-gaeshi.php
50 lines (47 loc) · 1.14 KB
/
donden-gaeshi.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Plugin Name: Donden Gaeshi
* Plugin URI: https://kunoichiwp.com/product/plugin/kagebunshin
* Description: Swap first name and last name in Japanese.
* Version: nightly
* Author: Kunoichi INC.
* Author URI: https://kunoichiwp.com
* License: GPL 3.0 or later
* Text Domain: donden-gaeshi
* Domain Path: /languages
* @package donden
*/
defined( 'ABSPATH' ) || die();
/**
* Plugin init.
*/
function donden_init() {
// Register text domain.
load_plugin_textdomain( 'donden-gaeshi', false, basename( __DIR__ ) . '/languages' );
// Include composer.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
if ( is_dir( __DIR__ . '/includes' ) ) {
foreach ( scandir( __DIR__ . '/includes' ) as $file ) {
if ( preg_match( '#^[^._].*\.php#u', $file ) ) {
require __DIR__ . '/includes/' . $file;
}
}
}
}
add_action( 'plugins_loaded', 'donden_init' );
/**
* Get plugin version.
*
* @return string
*/
function donden_version() {
static $info = null;
if ( is_null( $info ) ) {
$info = get_file_data( __FILE__, [
'version' => 'Version',
] );
}
return $info['version'];
}