-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphoto-block.php
87 lines (78 loc) · 2.01 KB
/
photo-block.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 // phpcs:ignore
/*
* Plugin Name: Photo Block
* Plugin URI: https://dlxplugins.com/plugins/photo-block/
* Description: An easy to use, but comprehensive photo block for WordPress
* Author: DLX Plugins
* Version: 1.0.14
* Requires at least: 6.5
* Requires PHP: 7.2
* Author URI: https://dlxplugins.com/plugins/photo-block/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: photo-block
* Contributors: ronalfy
*/
namespace DLXPlugins\PhotoBlock;
define( 'DLX_PHOTO_BLOCK_VERSION', '1.0.14' );
define( 'DLX_PHOTO_BLOCK_CACHE_VERSION', '1.0.1' ); // For cache busting global styles.
define( 'DLX_PHOTO_BLOCK_FILE', __FILE__ );
// Support for site-level autoloading.
if ( file_exists( __DIR__ . '/lib/autoload.php' ) ) {
require_once __DIR__ . '/lib/autoload.php';
}
/**
* PhotoBlock Main Class
*/
class PhotoBlock {
/**
* Photo Block instance.
*
* @var PhotoBlock $instance Instance of Highlight and Share class.
*/
private static $instance = null;
/**
* Return an instance of the class
*
* Return an instance of the PhotoBlock Class.
*
* @since 1.0.0
* @access public
*
* @return PhotoBlock class instance.
*/
public static function get_instance() {
if ( null == self::$instance ) { // phpcs:ignore
self::$instance = new self();
}
return self::$instance;
}
/**
* Class constructor.
*
* Initialize plugin and load text domain for internationalization
*
* @since 1.0.0
* @access private
*/
private function __construct() {
// i18n initialization.
load_plugin_textdomain( 'photo-block', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
/**
* Entry point for the plugin.
*/
public function plugins_loaded() {
Blocks::run();
Global_Styles::run();
Rest::run();
}
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\photo_block_instantiate' );
/**
* Instantiate the HAS class.
*/
function photo_block_instantiate() {
$photoblock = PhotoBlock::get_instance();
$photoblock->plugins_loaded();
}