-
Notifications
You must be signed in to change notification settings - Fork 1
/
mary-go-round.php
80 lines (61 loc) · 2.13 KB
/
mary-go-round.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
<?php
/*
Author: Nick Haskins
Author URI: http://nickhaskins.com
Plugin Name: Mary Go Round by Bearded Avenger
Plugin URI: http://nickhaskins.co/products/mary-go-round
Version: 1.0.2
Description: Responsive Wordpress carousel shortcode with smart gallery builder
*/
class baMaryGoRound {
const version = '1.0.2';
function __construct() {
$this->dir = plugin_dir_path( __FILE__ );
$this->url = plugins_url( '', __FILE__ );
include('type.php');
include('shortcode.php');
include('columns.php');
include('updater.php');
// hide acf UI
if (!defined('ACF_LITE')) {
define( 'ACF_LITE' , true );
}
// load acf
if( !class_exists( 'Acf' ) ) {
include_once('libs/advanced-custom-fields/acf.php' );
}
// load acf gallery
if( !function_exists( 'acfgp_register_fields' ) ){
include_once('libs/advanced-custom-fields/add-ons/acf-gallery/acf-gallery.php');
}
// Load Updater
if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
// load our custom updater
include( 'EDD_SL_Plugin_Updater.php' );
}
// register ACF fields
include('acf-register.php');
// start the show
$this->init();
}
function init(){
add_action('wp_enqueue_scripts',array($this,'scripts'));
// only load the less file if we're in dms
add_action( 'template_redirect', array($this, 'dms_less' ));
}
function scripts(){
wp_enqueue_script('jquery');
wp_register_style( 'mgr-style', $this->url.'/libs/carousel/mgr.carousel.min.css', self::version, true);
wp_register_script('mgr-script', $this->url.'/libs/carousel/mgr.carousel.min.js', array('jquery'), self::version, true);
// colorbox
wp_register_style( 'mgr-lb-style', $this->url.'/libs/colorbox/colorbox.css', self::version, true);
wp_register_script('mgr-lb-script', $this->url.'/libs/colorbox/jquery.colorbox.js', array('jquery'), self::version, true);
}
// run dms less file
function dms_less() {
$file = sprintf( '%sstyle.less', $this->dir );
if(function_exists('pagelines_insert_core_less') && function_exists('pl_has_editor'))
pagelines_insert_core_less( $file );
}
}
new baMaryGoRound;