-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
51 lines (44 loc) · 1.52 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
<?php
/**
* Plugin Name: Image Comparison
* Description: Display two images in a comparison state.
* Version: 1.0.0-beta.1
* Requires at least: 6.3
* Requires PHP: 8.2
* Author: Big Bite®
* Author URI: https://bigbite.net
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Update URI: false
* Text Domain: bigbite-image-comparison
*/
namespace Big_Bite\Image_Comparison;
// exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'BIGBITE_IMAGE_COMPARISON_PLUGIN_DIR', __DIR__ );
if ( file_exists( BIGBITE_IMAGE_COMPARISON_PLUGIN_DIR . '/inc/asset-settings.php' ) ) {
include_once BIGBITE_IMAGE_COMPARISON_PLUGIN_DIR . '/inc/asset-settings.php';
}
if (
! defined( 'BIGBITE_IMAGE_COMPARISON_EDITOR_CSS' ) ||
! defined( 'BIGBITE_IMAGE_COMPARISON_EDITOR_JS' ) ||
! defined( 'BIGBITE_IMAGE_COMPARISON_SHARED_CSS' ) ||
! defined( 'BIGBITE_IMAGE_COMPARISON_FRONTEND_CSS' ) ||
! defined( 'BIGBITE_IMAGE_COMPARISON_EDITOR_DEPENDENCIES' ) ||
! defined( 'BIGBITE_IMAGE_COMPARISON_VERSION' )
) {
add_action(
'all_admin_notices',
function () {
printf(
'<div class="notice notice-error is-dismissible"><p>%s</p></div>',
esc_html__( 'Image Comparison asset constants are not defined. You may need to run an asset build.', 'bigbite-image-comparison' )
);
}
);
return;
}
require_once BIGBITE_IMAGE_COMPARISON_PLUGIN_DIR . '/inc/class-loader.php';
new Loader( BIGBITE_IMAGE_COMPARISON_PLUGIN_DIR );