-
Notifications
You must be signed in to change notification settings - Fork 0
/
coop-slideshow.php
67 lines (59 loc) · 1.73 KB
/
coop-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
60
61
62
63
64
65
66
67
<?php
/**
* Coop Slideshow Admin
*
* A slideshow/carousel for use with the Prototype theme.
*
* PHP Version 7
*
* @package BCLibCoop\SlideshowAdmin
* @author Erik Stainsby <eric.stainsby@roaringsky.ca>
* @author Ben Holt <ben.holt@bc.libraries.coop>
* @author Jonathan Schatz <jonathan.schatz@bc.libraries.coop>
* @author Sam Edwards <sam.edwards@bc.libraries.coop>
* @copyright 2013-2022 BC Libraries Cooperative
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: Coop Slideshow Admin
* Description: Slideshow setup configurator
* Version: 3.3.6
* Network: true
* Requires at least: 5.2
* Requires PHP: 7.0
* Author: BC Libraries Cooperative
* Author URI: https://bc.libraries.coop
* Text Domain: coop-slideshow
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
namespace BCLibCoop;
// No Direct Access
defined('ABSPATH') || die(-1);
define('COOP_SLIDESHOW_PLUGIN', __FILE__);
/**
* Require Composer autoloader if installed on it's own
*/
if (file_exists($composer = __DIR__ . '/vendor/autoload.php')) {
require_once $composer;
}
/**
* Hook on plugins_loaded for friendlier priorities
*/
add_action('plugins_loaded', function () {
SlideshowDatabase::activate();
/**
* Only load admin interfaces for an admin request
*/
add_action('init', function () {
if (is_admin()) {
new SlideshowAdmin();
}
});
/**
* Only load the frontend features for a frontend request
*/
add_action('template_redirect', function () {
new SlideshowFrontend();
});
});