-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwordpress-slideshow.php
59 lines (54 loc) · 1.96 KB
/
wordpress-slideshow.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
<?php
/**
* This is plugin bootstrap file.
*
* @package WP_Slideshow
* @since 1.0.0
*/
/**
* Plugin Name: WordPress Slideshow
* Description: A simple WordPress Slideshow
* Requires PHP: 7.4
* Requires at least: 5.4
* Version: 1.0.0
*
* @package WP_Slideshow
*/
/* A security measure to prevent direct access to the plugin file. */
if ( ! defined( 'WPINC' ) ) {
die;
}
/* Checking if WP_Slideshow_Singleton exists and if it doesn't, it is including it. */
if ( ! trait_exists( 'WP_Slideshow_Singleton' ) ) {
require_once plugin_dir_path( __FILE__ ) . '/includes/trait-wp-slideshow-singleton.php';
}
/* Checking if the class WP_Slideshow_Assets exists and if it doesn't, it is including it. */
if ( ! class_exists( 'WP_Slideshow_Assets' ) ) {
require_once plugin_dir_path( __FILE__ ) . '/includes/class-wp-slideshow-assets.php';
}
WP_Slideshow_Assets::get_instances();
/* Checking if the user is in the admin area and if it is,
it is including the class WP_Slideshow_Settings.
If the user is not in the admin area,
it is including the class WP_Slideshow. */
if ( is_admin() ) {
if ( wp_doing_ajax() ) {
/* Checking if the class WP_Slideshow_Settings exists and if it doesn't, it is including it. */
if ( ! class_exists( 'WP_Slideshow_Ajax' ) ) {
require_once plugin_dir_path( __FILE__ ) . '/includes/class-wp-slideshow-ajax.php';
}
WP_Slideshow_Ajax::get_instances();
} else {
/* Checking if the class WP_Slideshow_Settings exists and if it doesn't, it is including it. */
if ( ! class_exists( 'WP_Slideshow_Settings' ) ) {
require_once plugin_dir_path( __FILE__ ) . '/includes/class-wp-slideshow-settings.php';
}
WP_Slideshow_Settings::get_instances();
}
} else {
/* Checking if WP_Slideshow exists and if it doesn't, it is creating it. */
if ( ! class_exists( 'WP_Slideshow_Shortcode' ) ) {
require_once plugin_dir_path( __FILE__ ) . '/includes/class-wp-slideshow-shortcode.php';
}
WP_Slideshow_Shortcode::get_instances();
}