-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtscf.php
50 lines (46 loc) · 1.36 KB
/
tscf.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: TSCF - Tarosky Custom Filed manager
Plugin URI: https://github.com/tarosky/tscf
Description: TaroSky's Custom Field manager. Scalable, Well-Structured and Maintainable. Requires PHP5.4 or later.
Author: TAROSKY INC. <info@tarosky.co.jp>
Version: 1.1.5
Author URI: https://tarosky.co.jp
Text Domain: tscf
Domain Path: /languages/
License: GPL v3 or later.
*/
defined( 'ABSPATH' ) || die();
// Register bootstrap.
add_action( 'plugins_loaded', 'tscf_plugins_loaded' );
/**
* Plugin bootstrap
*
* @internal
*/
function tscf_plugins_loaded() {
// Add translation.
load_plugin_textdomain( 'tscf', false, 'tscf/languages' );
// Start.
if ( version_compare( phpversion(), '5.4.*', '<' ) ) {
add_action( 'admin_notices', 'tscf_admin_notice' );
} else {
// Requirements O.K.
$path = __DIR__ . '/vendor/autoload.php';
if ( ! file_exists( $path ) ) {
trigger_error( __( 'Mmm...TSCF plugin\'s auto loader missing. Did you run composer install?', 'tscf' ), E_USER_WARNING );
} else {
require $path;
call_user_func( array( 'Tarosky\\TSCF\\Bootstrap', 'instance' ) );
}
}
}
/**
* Show error on admin screen
*
* @internal
* @return void
*/
function tscf_admin_notice() {
printf( '<div class="error"><p>%s</p></div>', esc_html( __( '[Error] TSCF requires PHP version 5.4 and over. Please consider upgrading your PHP.', 'tscf' ) ) );
}