-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgformify.php
45 lines (34 loc) · 1.28 KB
/
gformify.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
<?php
/*
Plugin Name: Gformify
Plugin URI: http://www.coplex.com
Description: Wrap/Add Bootstrap classes and styles for Gravity Forms
Version: 0.1
Author: Coplex
Author URI: http://www.coplex.com
License: GPL2
*/
defined('ABSPATH') or die("You will not pass");
/**
* Enqueue styles
*
* Note: I'll need to refactor this to point to the minified file when gulp starts minifying our style assets
*/
class gformifyEnqueue
{
// Constructor method called on each new created object
public function __construct() {
add_action('wp_enqueue_scripts', array($this, 'enqueueAssets'));
}
public function enqueueAssets() {
wp_register_style( 'gformify-style', plugins_url( 'gformify/assets/css/gformify.less' ), array(), '3.3.1' );
wp_register_script( 'gformify', plugins_url( 'gformify/assets/js/gformify.js' ), array('jquery'), null, false );
// Need to set this as a fallback and check theme for bootstrap before enqueuing
wp_register_style( 'co-gformify', '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css', array(), '3.3.1' );
wp_enqueue_style( 'gformify-style' );
wp_enqueue_script( 'gformify' );
wp_enqueue_style( 'co-gformify' );
}
}
$enqueue = new gformifyEnqueue;
?>