-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalerts-dlx.php
104 lines (91 loc) · 2.37 KB
/
alerts-dlx.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
<?php
/**
* Plugin Name: AlertsDLX
* Plugin URI: https://dlxplugins.com/plugins/alertsdlx/
* Description: Create beautiful and impactful alerts and notifications in your content, inspired by Bootstrap, Material, Chakra UI, and Shoelace.
* Version: 2.0.2
* Requires at least: 5.9
* Requires PHP: 7.2
* Author: DLX Plugins
* Author URI: https://dlxplugins.com/plugins/alertsdlx/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: alerts-dlx
* Domain Path: /languages
*
* @package AlertsDLX
*/
namespace DLXPlugins\AlertsDLX;
define( 'ALERTS_DLX_VERSION', '2.0.2' );
define( 'ALERTS_DLX_FILE', __FILE__ );
// Support for site-level autoloading.
if ( file_exists( __DIR__ . '/lib/autoload.php' ) ) {
require_once __DIR__ . '/lib/autoload.php';
}
/**
* AlertsDLX class.
*/
class AlertsDLX {
/**
* Holds the class instance.
*
* @var AlertsDLX $instance
*/
private static $instance = null;
/**
* Return an instance of the class
*
* Return an instance of the ReflectorDLX Class.
*
* @since 1.0.0
*
* @return AlertsDLX class instance.
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Class initializer.
*/
public function plugins_loaded() {
load_plugin_textdomain(
'alerts-dlx',
false,
basename( __DIR__ ) . '/languages'
);
Blocks::run();
/**
* When AlertsDLX can be extended.
*
* Filter when AlertsDLX can be extended.
*
* @since 1.0.0
*/
do_action( 'alerts_dlx_loaded' );
}
/**
* Init all the things.
*/
public function init() {
// Nothing here yet.
}
}
add_action(
'plugins_loaded',
function () {
$alerts_dlx = AlertsDLX::get_instance();
$alerts_dlx->plugins_loaded();
}
);
// Custom the_content filter for output and no conflicts.
global $wp_embed;
add_filter( 'alerts_dlx_the_content', array( $wp_embed, 'run_shortcode' ), 8 );
add_filter( 'alerts_dlx_the_content', array( $wp_embed, 'autoembed' ), 8 );
add_filter( 'alerts_dlx_the_content', 'wptexturize' );
add_filter( 'alerts_dlx_the_content', 'convert_chars' );
add_filter( 'alerts_dlx_the_content', 'wpautop' );
add_filter( 'alerts_dlx_the_content', 'shortcode_unautop' );
add_filter( 'alerts_dlx_the_content', 'do_shortcode' );