-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
105 lines (86 loc) · 2.27 KB
/
plugin.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
99
100
101
102
103
104
105
<?php
/**
* Experimental thumbnail shortcodes for the Connections Business Directory plugin.
*
* @package Connections Business Directory Extension - Thumbnail Shortcodes
* @category Template
* @author Steven A. Zahm
* @license GPL-2.0+
* @link https://connections-pro.com
* @copyright 2023 Steven A. Zahm
*
* @wordpress-plugin
* Plugin Name: Connections Business Directory Extension - Thumbnail Shortcodes
* Plugin URI: https://connections-pro.com
* Description: Experimental thumbnail shortcodes for the Connections Business Directory plugin.
* Version: 1.0
* Requires at least: 5.6
* Requires PHP: 7.0
* Author: Steven A. Zahm
* Author URI: https://connections-pro.com
* License: GPL-2.0+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: cn_thumbnail_shortcodes
* Domain Path: /languages
*/
namespace Connections_Directory\Extension;
use Connections_Directory\Extension\Thumbnail_Shortcodes\Shortcode;
final class Thumbnail_Shortcodes {
/**
* @var self
*/
private static $instance;
/**
* @var string The absolute path this file.
*
* @since 1.0
*/
private $file = '';
/**
* @var string The URL to the plugin's folder.
*
* @since 1.0
*/
private $url = '';
/**
* @var string The absolute path to this plugin's folder.
*
* @since 1.0
*/
private $path = '';
/**
* @var string The basename of the plugin.
*
* @since 1.0
*/
private $basename = '';
public static function instance(): self {
if ( ! self::$instance instanceof self ) {
$self = new self();
$self->file = __FILE__;
$self->url = plugin_dir_url( $self->file );
$self->path = plugin_dir_path( $self->file );
$self->basename = plugin_basename( $self->file );
$self->includeDependencies();
Shortcode\Thumbnail::add();
Shortcode\Thumbnail_Responsive::add();
self::$instance = $self;
}
return self::$instance;
}
/**
* Include plugin dependencies.
*
* @since 1.0
*/
private function includeDependencies() {
include_once 'Shortcode/Thumbnail.php';
include_once 'Shortcode/Thumbnail_Responsive.php';
}
}
add_action(
'Connections_Directory/Loaded',
static function() {
Thumbnail_Shortcodes::instance();
}
);