-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin.php
More file actions
76 lines (61 loc) · 2.16 KB
/
plugin.php
File metadata and controls
76 lines (61 loc) · 2.16 KB
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
<?php
/*
Plugin Name: Styles Control: Group
Plugin URI: http://stylesplugin.com/
Description: Add a "group" control type to Styles.
Version: 1.0
Author: Brainstorm Media
Author URI: http://brainstormmedia.com
*/
/**
* Copyright (c) 2013 Brainstorm Media. All rights reserved.
*
* Released under the GPL license
* http://www.opensource.org/licenses/gpl-license.php
*
* This is an add-on for WordPress
* http://wordpress.org/
*
* **********************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* **********************************************************************
*/
new Styles_Control_Group_Plugin();
/**
* Enqueue necessary files when needed by the WordPress Costumizer.
*
* Example JSON usage:
* { "type": "group", "label": "Most awesome group ever" },
*/
class Styles_Control_Group_Plugin {
/**
* Version of the plugin. Used to cache-bust enqueued scripts and styles.
*/
var $version = '1.0';
public function __construct() {
add_action( 'customize_register', array( $this, 'customize_register' ), 5 );
add_action( 'customize_controls_enqueue_scripts', array( $this, 'customize_controls_enqueue_scripts' ) );
}
/**
* Include the class to make available to Styles.
* Styles looks for class "Styles_Control_Foo_Bar"
* when presented with { type: "foo-bar" } in customize.json
*/
public function customize_register(){
include dirname( __FILE__ ) . '/inc/styles-control-group.php';
}
/**
* Supporting CSS or Javascript for use in WordPress Customizer
*/
function customize_controls_enqueue_scripts() {
wp_enqueue_style( 'styles-control-group', plugins_url( '/inc/styles-control-group.css', __FILE__ ), array(), $this->version );
}
}