-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zr-lightbox.php
executable file
·98 lines (87 loc) · 2.21 KB
/
zr-lightbox.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
92
93
94
95
96
97
98
<?php
/**
* ZIOR Lightbox
*
* Plugin Name: ZIOR Lightbox
* Description: Convert all content images into lightbox.
* Version: 0.1.0
* Author: ZIORWeb.Dev
* Author URI: https://github.com/ZIORWebDev
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
* Text Domain: zior-lightbox
* Requires at least: 4.9
* Tested up to: 6.1
* Requires PHP: 7.4
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License version 2, as published by the Free Software Foundation. You may NOT assume
* that you can use any other version of the GPL.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
class ZIOR_Lightbox {
/**
* @var ZIOR_Lightbox
*/
protected static $instance;
/**
* @var string
*/
protected $version = '0.1.0';
/**
* Get instance.
*
* @return static
* @since
* @access static
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
self::$instance->init();
}
return self::$instance;
}
public function init() {
$this->setup_constants();
$this->includes();
}
public function includes() {
require_once ZR_LIGHTBOX_PLUGIN_DIR . 'includes/actions.php';
require_once ZR_LIGHTBOX_PLUGIN_DIR . 'includes/settings.php';
}
/**
* Setup plugin constants
*
*/
private function setup_constants() {
// Plugin version.
if ( ! defined( 'ZR_LIGHTBOX_VERSION' ) ) {
define( 'ZR_LIGHTBOX_VERSION', $this->version );
}
// Plugin Folder Path.
if ( ! defined( 'ZR_LIGHTBOX_PLUGIN_DIR')) {
define( 'ZR_LIGHTBOX_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
// Plugin Folder URL.
if ( ! defined( 'ZR_LIGHTBOX_PLUGIN_URL' ) ) {
define( 'ZR_LIGHTBOX_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
// Plugin Root File.
if ( ! defined( 'ZR_LIGHTBOX_PLUGIN_FILE' ) )
{
define( 'ZR_LIGHTBOX_PLUGIN_FILE', __FILE__ );
}
}
}
/**
* Start the plugin.
*
* @return ZIOR_Lightbox
*/
function ZIOR_Lightbox_Initialize() {
return ZIOR_Lightbox::instance();
}
ZIOR_Lightbox_Initialize();