-
Notifications
You must be signed in to change notification settings - Fork 0
/
ultimate-3d-testimonial-slider.php
96 lines (85 loc) · 2.82 KB
/
ultimate-3d-testimonial-slider.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
<?php
/**
* Plugin Name: Ultimate 3D Testimonial Slider
* Plugin URI: https://wordpress.org/plugins/ultimate-3d-testimonial-slider
* Description: Easily create responsive 3D carousel slider for testimonial and insert into any page or page via shortcode.
* Version: 1.0.1
* Author: Monzur Alam
* Author URI: https://profiles.wordpress.org/monzuralam
* Text Domain: uts
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* GitHub Plugin URI: https://github.com/monzuralam/ultimate-3d-testimonial-slider
*/
// If this file is called directly, abort.
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly.
}
/**
* define constants
*/
define( 'UTS_VERSION', '1.0.1' );
define( 'UTS_FILE', __FILE__ );
define( 'UTS_PATH', dirname( UTS_FILE ) );
define( 'UTS_URL', plugins_url( '', UTS_FILE ) );
define( 'UTS_ASSETS', UTS_URL . '/assets' );
define( 'UTS_INCLUDES', UTS_PATH . '/includes' );
/**
* Enqueue CSS & JS
*/
if (!function_exists('uts_assets')) {
function uts_assets(){
wp_enqueue_style('uts', UTS_ASSETS . '/css/uts.css', array(), UTS_VERSION, 'all');
wp_enqueue_script('jquery');
wp_enqueue_script('modernizr', UTS_ASSETS . '/js/modernizr.min.js', array('jquery'), UTS_VERSION, false);
wp_enqueue_script('gallery', UTS_ASSETS . '/js/jquery.gallery.js', array('jquery'), UTS_VERSION, true);
wp_enqueue_script('uts', UTS_ASSETS . '/js/uts.js', array('jquery','gallery'), UTS_VERSION, true);
}
add_action('wp_enqueue_scripts', 'uts_assets');
}
/**
* Admin Assets
* @since 1.0.1
* @author Monzur Alam
*/
function uts_admin_assets(){
wp_enqueue_style('uts-admin', UTS_ASSETS . '/css/uts-admin.css', array(), UTS_VERSION, 'all');
wp_enqueue_script('uts-admin', UTS_ASSETS . '/js/uts-admin.js', array('jquery'), UTS_VERSION, true);
}
add_action('admin_enqueue_scripts', 'uts_admin_assets');
/**
* Activate the plugin.
*/
function uts_active() {
// Trigger our function that registers the cutsom post type plugin.
uts_setup_post_type();
// Clear the permalinks after the post type has been registered.
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'uts_active' );
/**
* Deactivation hook.
*/
function uts_deactivate() {
// Unregister the post type, so the rules are no longer in memory.
unregister_post_type( 'uts' );
// Clear the permalinks to remove our post type's rules from the database.
flush_rewrite_rules();
}
register_deactivation_hook( __FILE__, 'uts_deactivate' );
/**
* Cutsom Post Type
*/
require_once UTS_INCLUDES . '/cpt.php';
/**
* Cutsom Meta box
*/
require_once UTS_INCLUDES . '/metabox.php';
/**
* Shortcode
*/
require_once UTS_INCLUDES . '/shortcode.php';
/**
* Menu
*/
require_once UTS_INCLUDES . '/menu.php';