-
Notifications
You must be signed in to change notification settings - Fork 0
/
easy-image-gallery.php
87 lines (71 loc) · 2.2 KB
/
easy-image-gallery.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
<?php
/*
Plugin Name: Easy Image Gallery
Plugin URI: https://devrix.com/
Description: An easy to use image gallery with drag & drop re-ordering
Version: 1.5.1
Author: DevriX
Author URI: https://devrix.com/
Text Domain: easy-image-gallery
License: GPL-2.0+
License URI: http://www.opensource.org/licenses/gpl-license.php
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Easy_Image_Gallery' ) ) {
/**
* PHP5 constructor method.
*
* @since 1.0
*/
class Easy_Image_Gallery {
public function __construct() {
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
add_action( 'plugins_loaded', array( $this, 'constants' ) );
add_action( 'plugins_loaded', array( $this, 'includes' ) );
// add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'easy_image_gallery_plugin_action_links' );
}
/**
* Internationalization
*
* @since 1.0
*/
public function load_textdomain() {
load_plugin_textdomain( 'easy-image-gallery', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
/**
* Constants
*
* @since 1.0
*/
public function constants() {
if ( ! defined( 'EASY_IMAGE_GALLERY_DIR' ) ) {
define( 'EASY_IMAGE_GALLERY_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
}
if ( ! defined( 'EASY_IMAGE_GALLERY_URL' ) ) {
define( 'EASY_IMAGE_GALLERY_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
}
if ( ! defined( 'EASY_IMAGE_GALLERY_VERSION' ) ) {
define( 'EASY_IMAGE_GALLERY_VERSION', '1.2' );
}
if ( ! defined( 'EASY_IMAGE_GALLERY_INCLUDES' ) ) {
define( 'EASY_IMAGE_GALLERY_INCLUDES', EASY_IMAGE_GALLERY_DIR . trailingslashit( 'includes' ) );
}
}
/**
* Loads the initial files needed by the plugin.
*
* @since 1.0
*/
public function includes() {
require_once EASY_IMAGE_GALLERY_INCLUDES . 'template-functions.php';
require_once EASY_IMAGE_GALLERY_INCLUDES . 'scripts.php';
require_once EASY_IMAGE_GALLERY_INCLUDES . 'metabox.php';
require_once EASY_IMAGE_GALLERY_INCLUDES . 'admin-page.php';
require_once EASY_IMAGE_GALLERY_INCLUDES . 'gutenberg-block/plugin.php';
}
}
}
$easy_image_gallery = new Easy_Image_Gallery();