-
Notifications
You must be signed in to change notification settings - Fork 0
/
elbytes-elasticpress-woocommerce-poc.php
81 lines (69 loc) · 1.74 KB
/
elbytes-elasticpress-woocommerce-poc.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
<?php
/**
* Plugin Name: ElasticPress + Woocommerce Plugin
* Plugin URI: https://example.com/my-wordpress-plugin
* Description: Proof of Concept for a WooCommerce shop using ElasticPress
* Version: 1.0
* Author: 11bytes
* Author URI: https://11bytes.de
* License: GPL2
* Text Domain: elbytes-ep-woo
*
* @package elbytes-ep-woo
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Mail plugin class.
*/
class Elbytes_ElasticPress_Woo {
/**
* Constructor
*/
public function __construct() {
$this->constans();
$this->init();
}
/**
* Define plugin constants.
*/
private function constans() {
define( 'ELBYTES_EP_WOO_VERSION', '1.0.0' );
define( 'ELBYTES_EP_WOO_NAME', 'elbytes-ep-woo' );
// Paths.
define( 'ELBYTES_EP_WOO_PATH', plugin_dir_path( __FILE__ ) );
if ( ! defined( 'ELBYTES_EP_WOO_SRC_PATH' ) ) {
define( 'ELBYTES_EP_WOO_SRC_PATH', ELBYTES_EP_WOO_PATH . 'src/' );
}
if ( ! defined( 'ELBYTES_EP_WOO_ASSETS_PATH' ) ) {
define( 'ELBYTES_EP_WOO_ASSETS_PATH', ELBYTES_EP_WOO_PATH . 'assets/' );
}
}
/**
* Init main functions class.
*
* @return void
*/
private function init() {
require_once ELBYTES_EP_WOO_SRC_PATH . 'class-elastic-press-woo-init.php';
$plugin = new EP_Woo_Init();
}
/**
* Get plugin version.
*
* @return string
*/
public static function get_version() {
return ELBYTES_EP_WOO_VERSION;
}
/**
* Get plugin name.
*
* @return string
*/
public static function get_name() {
return ELBYTES_EP_WOO_NAME;
}
}
new Elbytes_ElasticPress_Woo();