forked from AyeCode/invoicing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
invoicing.php
67 lines (57 loc) · 1.34 KB
/
invoicing.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
<?php
/**
* Plugin Name: GetPaid
* Plugin URI: https://wpinvoicing.com/
* Description: A lightweight and VAT compliant payments and invoicing plugin.
* Version: 2.3.2
* Author: AyeCode Ltd
* Author URI: https://wpinvoicing.com
* Text Domain: invoicing
* Domain Path: /languages
* License: GPLv3
* Requires at least: 4.9
* Requires PHP: 5.3
*
* @package GetPaid
*/
defined( 'ABSPATH' ) || exit;
// Define constants.
if ( ! defined( 'WPINV_PLUGIN_FILE' ) ) {
define( 'WPINV_PLUGIN_FILE', __FILE__ );
}
if ( ! defined( 'WPINV_VERSION' ) ) {
define( 'WPINV_VERSION', '2.3.2' );
}
// Include the main Invoicing class.
if ( ! class_exists( 'WPInv_Plugin', false ) ) {
require_once plugin_dir_path( WPINV_PLUGIN_FILE ) . 'includes/class-wpinv.php';
}
/**
* Returns the main instance of Invoicing.
*
* @since 1.0.19
* @return WPInv_Plugin
*/
function getpaid() {
if ( empty( $GLOBALS['invoicing'] ) ) {
$GLOBALS['invoicing'] = new WPInv_Plugin();
}
return $GLOBALS['invoicing'];
}
/**
* Deactivation hook.
*
* @since 2.0.8
*/
function getpaid_deactivation_hook() {
update_option( 'wpinv_flush_permalinks', 1 );
}
register_deactivation_hook( __FILE__, 'getpaid_deactivation_hook' );
/**
* @deprecated
*/
function wpinv_run() {
return getpaid();
}
// Kickstart the plugin.
add_action( 'plugins_loaded', 'getpaid', -100 );