-
Notifications
You must be signed in to change notification settings - Fork 5
/
materializer.php
107 lines (82 loc) · 3.56 KB
/
materializer.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
97
98
99
100
101
102
103
104
105
106
107
<?php
/*
Plugin Name: Materializer
Plugin URI: http://codyreichert.github.io/materializer
Description: The Material Design components for WordPress
Author: Cody Reichert
Version: 0.2.0
Copyright (c) Cody Reichert - 2015
*/
/* Code starts here */
$pluginName = "Materializer";
$pluginVer = "0.1.0";
/** Load Shortcodes **/
require_once "shortcodes.php";
require_once "components/buttons.php";
require_once "components/cards.php";
require_once "components/collapsible.php";
require_once "components/collections.php";
require_once "components/dropdown.php";
require_once "components/footer.php";
require_once "components/images.php";
require_once "components/pagination.php";
require_once "components/preloader.php";
require_once "components/tables.php";
require_once "components/videos.php";
class MaterializerBase {
public static function enqueueClientStyles() {
wp_register_style( 'M-Style-Bundle',
plugins_url('scripts/dist/Materializer-bundle.css', __FILE__)
);
wp_enqueue_style('M-Style-Bundle');
}
public static function enqueueClientScripts() {
wp_register_script('M-Script-bundle',
plugins_url('scripts/dist/Materializer-bundle.js', __FILE__)
);
wp_enqueue_script('M-Script-bundle');
}
}
/** Enqueue Styles and Scripts **/
add_action('wp_enqueue_scripts', array('MaterializerBase', 'enqueueClientStyles' ));
add_action('wp_enqueue_scripts', array('MaterializerBase', 'enqueueClientScripts'));
/** Buttons */
add_shortcode('btn', array('Buttons', 'raisedButton'));
add_shortcode('btn_floating', array('Buttons', 'floatingButton'));
add_shortcode('btn_fixed_action', array('Buttons', 'fixedActionButton'));
add_shortcode('action', array('Buttons', 'fixedActionButtonAction'));
add_shortcode('btn_flat', array('Buttons', 'flatButton'));
add_shortcode('btn_large', array('Buttons', 'largeButton'));
/** Cards */
add_shortcode('card', array('Cards', 'basicCard'));
add_shortcode('card_img', array('Cards', 'imageCard'));
add_shortcode('card_reveal', array('Cards', 'revealCard'));
add_shortcode('link', array('Cards', 'actionLink'));
add_shortcode('card_open', array('Cards', 'cardRevealOpenContent'));
/** Collapsibles */
add_shortcode('collapsible', array('Collapsibles', 'collapsible'));
add_shortcode('collapsible_item', array('Collapsibles', 'collapsibleItem'));
/** Collections */
add_shortcode('collection', array('Collections', 'collection'));
add_shortcode('collection_item', array('Collections', 'collectionItem'));
add_shortcode('collection_link', array('Collections', 'collectionLink'));
/** Dropdowns */
add_shortcode('dropdown', array('Dropdowns', 'dropdown'));
add_shortcode('dropdown_item', array('Dropdowns', 'dropdownItem'));
/** Footer */
add_shortcode('footer', array('Footers', 'footer'));
/** Images */
add_shortcode('img_responsive', array('Images', 'responsiveImage'));
add_shortcode('img_circle', array('Images', 'circularImage'));
add_shortcode('img_box', array('Images', 'imageBox'));
/** Pagination */
add_shortcode('pagination', array('Paginations', 'pagination'));
add_shortcode('pag_item', array('Paginations', 'paginationItem'));
/** Preloaders */
add_shortcode('preloader_linear', array('Preloaders', 'linearPreloader'));
add_shortcode('preloader_circular', array('Preloaders', 'circularPreloader'));
/** Tables */
add_shortcode('table', array('Tables', 'basicTable'));
/** Videos */
add_shortcode('video', array('Videos', 'externalVideo'));
add_shortcode('video_html5', array('Videos', 'localVideo'));