-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdelivery-date-system.php
88 lines (79 loc) · 1.97 KB
/
delivery-date-system.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
<?php
/**
* Plugin Name: Delivery Date System for WooCommerce
* Plugin URI: https://github.com/HasteDesign/Delivery-Date-System-for-Woocommerce
* Description: Offers to your customers the option to select the delivery date and period
* Version: 1.0.0
* Author: Haste
* Author URI: https://www.hastedesign.com.br
* License: GPLv2
* Text Domain: delivery-date-system
* Domain Path: languages/
* WC requires at least: 3.0.0
* WC tested up to: 3.5.5
*/
// Prevents direct access
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Delivery_Date_System' ) ) {
class Delivery_Date_System {
/**
* Current version number
*
* @var string
* @since 1.0.0
*/
const VERSION = '1.0.0';
/**
* Instance of this class.
*
* @var object
*/
protected static $instance = null;
/**
* Plugin directory path
*
* @var string
*/
private $plugin_dir = null;
/**
* Initialize the plugin.
*/
function __construct() {
$this->plugin_dir = plugin_dir_path( __FILE__ );
add_action( 'init', array( $this, 'load_textdomain' ) );
add_action( 'init', array( $this, 'includes' ), 0 );
}
/**
* Return the plugin instance.
*/
public static function init() {
// If the single instance hasn't been set, set it now.
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
/**
* A final check if Haste Toolkit exists before kicking off our Haste Toolkit loading.
* Delivery_Date_System_VERSION is defined at this point.
*
* @since 1.0.0
*/
public function includes() {
// Load the functions.php
require_once $this->plugin_dir . '/functions.php';
}
/**
* Load plugin translation
*/
public function load_textdomain() {
load_plugin_textdomain( 'delivery-date-system', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
}
}
/**
* Initialize the plugin actions.
*/
add_action( 'plugins_loaded', array( 'Delivery_Date_System', 'init' ) );