-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
munim.php
91 lines (83 loc) · 2.11 KB
/
munim.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* Plugin Name: Munim - Simple Invoices
* Plugin URI: https://www.munim.com
* Description: Simple invoicing in your admin panel.
* Author: lubus
* Author URI: https://www.lubus.in
* Version: 0.1.0
* Text Domain: munim
* Domain Path: /languages
* Tags: invoice, invoicing,
* Requires at least: 3.0.1
* Tested up to: 5.0.3
* Stable tag: 1.0.0
* License: GPL2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*
* @package munim
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Setup Constants
*/
// Plugin version.
if ( ! defined( 'MUNIM_VERSION' ) ) {
define( 'MUNIM_VERSION', '0.1.0' );
}
// Plugin Root File.
if ( ! defined( 'MUNIM_PLUGIN_FILE' ) ) {
define( 'MUNIM_PLUGIN_FILE', __FILE__ );
}
// Plugin Folder Path.
if ( ! defined( 'MUNIM_PLUGIN_DIR' ) ) {
define( 'MUNIM_PLUGIN_DIR', plugin_dir_path( MUNIM_PLUGIN_FILE ) );
}
// Plugin Folder URL.
if ( ! defined( 'MUNIM_PLUGIN_URL' ) ) {
define( 'MUNIM_PLUGIN_URL', plugin_dir_url( MUNIM_PLUGIN_FILE ) );
}
// Plugin Basename aka: "munim/munim.php".
if ( ! defined( 'MUNIM_PLUGIN_BASENAME' ) ) {
define( 'MUNIM_PLUGIN_BASENAME', plugin_basename( MUNIM_PLUGIN_FILE ) );
}
// Plugin upload path aka: "/wp-content/uploads/munim".
if ( ! defined( 'MUNIM_PLUGIN_UPLOAD' ) ) {
$upload = wp_upload_dir();
$upload_dir = $upload['basedir'];
$upload_dir = $upload_dir . '/munim/';
define( 'MUNIM_PLUGIN_UPLOAD', $upload_dir );
}
/**
* Munim install on activation
*
* @return void
*/
function munim_install() {
// Create directory under uploads.
if ( ! is_dir( MUNIM_PLUGIN_UPLOAD ) ) {
mkdir( MUNIM_PLUGIN_UPLOAD, 0700 );
}
}
register_activation_hook( __FILE__, 'munim_install' );
// Autoloader.
require_once 'vendor/autoload.php';
require_once 'vendor/cmb2/init.php';
require_once 'vendor/cmb2-field-post-search-ajax/cmb-field-post-search-ajax.php';
// Bootstrap Munim.
use LubusIN\Munim\Munim;
/**
* Main instance of Munim.
*
* Returns the main instance of Munim to prevent the need to use globals.
*
* @since 0.1.0
* @return Munim
*/
function munim() {
return Munim::get_instance();
}
munim();