-
Notifications
You must be signed in to change notification settings - Fork 0
/
hanmoto-helper.php
59 lines (54 loc) · 1.21 KB
/
hanmoto-helper.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
51
52
53
54
55
56
57
58
59
<?php
/*
Plugin Name: Hanmoto Helper
Plugin URI: https://github.com/hametuha/isbn-beautify
Description: Display Book information with ISBN. Using OpenBD.
Author: hametuha,Takahashi_Fumiki
Version: 1.0.0
Author URI: https://hametuha.co.jp/
License: GPL 3.0 or later
Text Domain: hanmoto
Domain Path: /languages
*/
defined( 'ABSPATH' ) or die();
/**
* Get plugin version.
*
* @return string
*/
function hanmoto_version() {
static $info = null;
// Get version number.
if ( is_null( $info ) ) {
$info = get_file_data( __FILE__, array(
'version' => 'Version',
) );
}
return $info['version'];
}
/**
* Get root path.
*
* @return string
*/
function hanmoto_root_dir() {
return __DIR__;
}
/**
* Register hooks.
*/
function hanmoto_plugin_init() {
// Load translations.
load_plugin_textdomain( 'hanmoto', true, basename( __DIR__ ) . '/languages' );
// Hooks
require_once __DIR__ . '/hooks/shortcode.php';
// Functions.
require_once __DIR__ . '/includes/utility.php';
// autoloader.
$autoloader = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $autoloader ) ) {
require_once $autoloader;
\Hametuha\HanmotoHelper\Bootstrap::get_instance();
}
}
add_action( 'plugins_loaded', 'hanmoto_plugin_init' );