/
crellyslider.php
57 lines (45 loc) · 1.7 KB
/
crellyslider.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
<?php
/**
* Plugin Name: Crelly Slider
* Plugin URI: https://wordpress.org/plugins/crelly-slider/
* Description: A free responsive slider that supports layers. Add texts, images, videos and beautify them with transitions and animations.
* Version: 1.4.5
* Author: Fabio Rinaldi
* Author URI: https://github.com/fabiorino
* Text Domain: crelly-slider
* License: MIT
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/*************/
/** GLOBALS **/
/*************/
define('CS_DEBUG', true);
define('CS_VERSION', '1.4.5');
define('CS_MIN_CAPABILITY', 'manage_options');
define('CS_PATH', plugin_dir_path(__FILE__));
define('CS_PLUGIN_URL', plugins_url() . '/crelly-slider');
require_once CS_PATH . 'wordpress/common.php';
require_once CS_PATH . 'wordpress/tables.php';
require_once CS_PATH . 'wordpress/frontend.php';
// Create (or remove) 3 tables: the sliders settings, the slides settings and the elements proprieties. We will also store the current version of the plugin
register_activation_hook(__FILE__, array('CrellySliderTables', 'setVersion'));
register_activation_hook(__FILE__, array('CrellySliderTables', 'setTables'));
register_uninstall_hook(__FILE__, array('CrellySliderTables', 'clearDatabase'));
// CSS and Javascript
CrellySliderCommon::setEnqueues();
CrellySliderFrontend::addShortcode();
if(is_admin()) {
require_once CS_PATH . 'wordpress/admin.php';
// Tables
if(CS_DEBUG || CS_VERSION != get_option('cs_version')) {
CrellySliderTables::setTables();
}
if(CS_VERSION != get_option('cs_version')) {
CrellySliderTables::setVersion();
}
CrellySliderAdmin::loadAssets();
CrellySliderAdmin::showSettings();
// Ajax functions
require_once CS_PATH . 'wordpress/ajax.php';
}
?>