Kadence Themes Toolkit - Version 2.0

Version Description

  • Move gallery to plugin.
  • Add button hover color.
Download this release

Release Info

Developer britner
Plugin Icon wp plugin Kadence Themes Toolkit
Version 2.0
Comparing to
See all releases

Code changes from version 1.9 to 2.0

gallery.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Re-create the [gallery] shortcode and use thumbnails styling from kadencethemes
5
+ *
6
+ */
7
+ function kadence_shortcode_gallery($attr) {
8
+ $post = get_post();
9
+ static $instance = 0;
10
+ $instance++;
11
+
12
+ if (!empty($attr['ids'])) {
13
+ if (empty($attr['orderby'])) {
14
+ $attr['orderby'] = 'post__in';
15
+ }
16
+ $attr['include'] = $attr['ids'];
17
+ }
18
+
19
+ $output = apply_filters('post_gallery', '', $attr);
20
+
21
+ if ($output != '') {
22
+ return $output;
23
+ }
24
+
25
+ if (isset($attr['orderby'])) {
26
+ $attr['orderby'] = sanitize_sql_orderby($attr['orderby']);
27
+ if (!$attr['orderby']) {
28
+ unset($attr['orderby']);
29
+ }
30
+ }
31
+
32
+ extract(shortcode_atts(array(
33
+ 'order' => 'ASC',
34
+ 'orderby' => 'menu_order ID',
35
+ 'id' => $post->ID,
36
+ 'itemtag' => '',
37
+ 'icontag' => '',
38
+ 'captiontag' => '',
39
+ 'columns' => 3,
40
+ 'size' => 'full',
41
+ 'include' => '',
42
+ 'exclude' => ''
43
+ ), $attr));
44
+
45
+ $id = intval($id);
46
+
47
+ if ($order === 'RAND') {
48
+ $orderby = 'none';
49
+ }
50
+
51
+ $gallery_rn = (rand(10,100));
52
+
53
+ if (!empty($include)) {
54
+ $_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
55
+
56
+ $attachments = array();
57
+ foreach ($_attachments as $key => $val) {
58
+ $attachments[$val->ID] = $_attachments[$key];
59
+ }
60
+ } elseif (!empty($exclude)) {
61
+ $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
62
+ } else {
63
+ $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
64
+ }
65
+
66
+ if (empty($attachments)) {
67
+ return '';
68
+ }
69
+
70
+ if (is_feed()) {
71
+ $output = "\n";
72
+ foreach ($attachments as $att_id => $attachment) {
73
+ $output .= wp_get_attachment_link($att_id, $size, true) . "\n";
74
+ }
75
+ return $output;
76
+ }
77
+ // NORMAL
78
+ $output .= '<div id="kad-wp-gallery'.$gallery_rn.'" class="kad-wp-gallery kad-light-wp-gallery clearfix rowtight">';
79
+ if ($columns == '2') {$itemsize = 'tcol-lg-6 tcol-md-6 tcol-sm-6 tcol-xs-12 tcol-ss-12'; $imgsize = 600;}
80
+ else if ($columns == '1') {$itemsize = 'tcol-lg-12 tcol-md-12 tcol-sm-12 tcol-xs-12 tcol-ss-12'; $imgsize = 1200;}
81
+ else if ($columns == '3'){ $itemsize = 'tcol-lg-4 tcol-md-4 tcol-sm-4 tcol-xs-6 tcol-ss-12'; $imgsize = 400;}
82
+ else if ($columns == '6'){ $itemsize = 'tcol-lg-2 tcol-md-2 tcol-sm-3 tcol-xs-4 tcol-ss-6'; $imgsize = 300;}
83
+ else if ($columns == '8' || $columns == '9' || $columns == '7'){ $itemsize = 'tcol-lg-2 tcol-md-2 tcol-sm-3 tcol-xs-4 tcol-ss-4'; $imgsize = 260;}
84
+ else if ($columns == '12' || $columns == '11'){ $itemsize = 'tcol-lg-1 tcol-md-1 tcol-sm-2 tcol-xs-2 tcol-ss-3'; $imgsize = 240;}
85
+ else if ($columns == '5'){ $itemsize = 'tcol-lg-25 tcol-md-25 tcol-sm-3 tcol-xs-4 tcol-ss-6'; $imgsize = 300;}
86
+ else {$itemsize = 'tcol-lg-3 tcol-md-3 tcol-sm-4 tcol-xs-6 tcol-ss-12'; $imgsize = 300;}
87
+ $i = 0;
88
+ foreach ($attachments as $id => $attachment) {
89
+ $attachment_url = wp_get_attachment_url($id);
90
+ $image = aq_resize($attachment_url, $imgsize, $imgsize, true);
91
+ if(empty($image)) {$image = $attachment_url;}
92
+ $link = isset($attr['link']) && 'post' == $attr['link'] ? wp_get_attachment_link($id, $size, true, false) : wp_get_attachment_link($id, $size, false, false);
93
+
94
+ $output .= '<div class="'.$itemsize.' g_item"><div class="grid_item kad_gallery_fade_in gallery_item"><a href="'.$attachment_url.'" rel="lightbox[pp_gal]" class="lightboxhover">
95
+ <img src="'.$image.'" alt="'.esc_attr($attachment->post_excerpt).'" class="light-dropshaddow"/>';
96
+ $output .= '</a>';
97
+ $output .= '</div></div>';
98
+ }
99
+ $output .= '</div>';
100
+
101
+ return $output;
102
+ }
103
+ $pinnacle = get_option( 'pinnacle' );
104
+
105
+ if(isset($pinnacle['pinnacle_gallery']) && $pinnacle['pinnacle_gallery'] == '1' && (! function_exists( 'kadence_gallery' ) ) ) {
106
+ remove_shortcode('gallery');
107
+ add_shortcode('gallery', 'kadence_shortcode_gallery');
108
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: britner
3
  Tags:
4
  Requires at least: 3.2
5
  Tested up to: 4.0
6
- Stable tag: 1.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -22,6 +22,10 @@ Install the plugin into the `/wp-content/plugins/` folder, and activate it.
22
 
23
  == Changelog ==
24
 
 
 
 
 
25
  = 1.9 =
26
  * Fix some video shortcode issues.
27
  * Add support for portfolio excerpt.
3
  Tags:
4
  Requires at least: 3.2
5
  Tested up to: 4.0
6
+ Stable tag: 2.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
22
 
23
  == Changelog ==
24
 
25
+ = 2.0 =
26
+ * Move gallery to plugin.
27
+ * Add button hover color.
28
+
29
  = 1.9 =
30
  * Fix some video shortcode issues.
31
  * Add support for portfolio excerpt.
shortcodes.php CHANGED
@@ -184,13 +184,18 @@ function kad_vimeo_shortcode_function( $atts, $content) {
184
  //Button
185
  function kad_button_shortcode_function( $atts) {
186
  extract(shortcode_atts(array(
 
187
  'bcolor' => '',
 
 
188
  'link' => '',
189
  'text' => '',
190
  'target' => '_self',
191
  'tcolor' => '',
192
  ), $atts));
193
- return '<a href="'.$link.'" class="kad-btn kad-btn-primary" target="'.$target.'" style="background-color:'.$bcolor.'; color:'.$tcolor.'">'.$text.'</a>';
 
 
194
  }
195
  function kad_blockquote_shortcode_function( $atts, $content) {
196
  extract(shortcode_atts(array(
184
  //Button
185
  function kad_button_shortcode_function( $atts) {
186
  extract(shortcode_atts(array(
187
+ 'id' => rand(1, 99),
188
  'bcolor' => '',
189
+ 'bhovercolor' => '',
190
+ 'thovercolor' => '',
191
  'link' => '',
192
  'text' => '',
193
  'target' => '_self',
194
  'tcolor' => '',
195
  ), $atts));
196
+ $output = '<a href="'.$link.'" class="kad-btn kad-btn-primary" id="kadbtn'.$id.'" target="'.$target.'" style="background-color:'.$bcolor.'; color:'.$tcolor.'">'.$text.'</a>';
197
+ $output .= '<style type="text/css" media="screen">#kadbtn'.$id.':hover {background:'.$bhovercolor.' !important; color:'.$thovercolor.' !important;} </style>';
198
+ return $output;
199
  }
200
  function kad_blockquote_shortcode_function( $atts, $content) {
201
  extract(shortcode_atts(array(
shortcodes/btns/btns_popup.php CHANGED
@@ -32,6 +32,10 @@ var ButtonDialog = {
32
  var texthex = jQuery('#icon-dialog input#text-color-hex').val();
33
  var bcolor = jQuery('#icon-dialog select#btn-color').val();
34
  var btnhex = jQuery('#icon-dialog input#btn-color-hex').val();
 
 
 
 
35
  var btnlink = jQuery('#icon-dialog input#btn-link').val();
36
  var btarget = jQuery('#icon-dialog select#btn-target').val();
37
 
@@ -54,6 +58,20 @@ var ButtonDialog = {
54
  output += '';
55
  }
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  output += 'link="' + btnlink +'" ';
58
  output += 'target="' + btarget +'"';
59
  output += ']';
@@ -138,6 +156,61 @@ tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
138
  <input type="text" class="btn-hex" name="btn-color-hex" value="" id="btn-color-hex" />
139
  </div>
140
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  <div class="linebreak">
142
  <div>
143
  <label for="btn-link"><?php _e("Button Link", "virtue"); ?></label>
32
  var texthex = jQuery('#icon-dialog input#text-color-hex').val();
33
  var bcolor = jQuery('#icon-dialog select#btn-color').val();
34
  var btnhex = jQuery('#icon-dialog input#btn-color-hex').val();
35
+ var thovercolor = jQuery('#icon-dialog select#text-hover-color').val();
36
+ var texthoverhex = jQuery('#icon-dialog input#text-hover-color-hex').val();
37
+ var bhovercolor = jQuery('#icon-dialog select#btn-hover-color').val();
38
+ var btnhoverhex = jQuery('#icon-dialog input#btn-hover-color-hex').val();
39
  var btnlink = jQuery('#icon-dialog input#btn-link').val();
40
  var btarget = jQuery('#icon-dialog select#btn-target').val();
41
 
58
  output += '';
59
  }
60
  }
61
+ if(texthoverhex)
62
+ output += ' thovercolor=' + texthoverhex + ' ';
63
+ else {
64
+ output += 'thovercolor=' + thovercolor + ' ';
65
+ }
66
+ if(btnhoverhex) {
67
+ output += ' bhovercolor=' + btnhoverhex + ' ';
68
+ } else {
69
+ if(bhovercolor) {
70
+ output += 'bhovercolor=' + bhovercolor + ' ';
71
+ } else {
72
+ output += '';
73
+ }
74
+ }
75
  output += 'link="' + btnlink +'" ';
76
  output += 'target="' + btarget +'"';
77
  output += ']';
156
  <input type="text" class="btn-hex" name="btn-color-hex" value="" id="btn-color-hex" />
157
  </div>
158
  </div>
159
+ <div class="linebreak">
160
+ <div>
161
+ <label for="btn-color"><?php _e("Text Hover Color", "virtue"); ?></label>
162
+ <select name="btn-color" id="text-hover-color">
163
+ <option value="#FFF"><?php _e("White", "virtue"); ?></option>
164
+ <option value="#F2F2F2"><?php _e("Off-White", "virtue"); ?></option>
165
+ <option value="#000"><?php _e("Black", "virtue"); ?></option>
166
+ <option value="#CDCDCD"><?php _e("Light-Gray", "virtue"); ?></option>
167
+ <option value="#999"><?php _e("Gray", "virtue"); ?></option>
168
+ <option value="#444"><?php _e("Dark-Gray", "virtue"); ?></option>
169
+ <option value="#CCC"><?php _e("Silver", "virtue"); ?></option>
170
+ <option value="#FF0000"><?php _e("Red", "virtue"); ?></option>
171
+ <option value="#0000FF"><?php _e("Blue", "virtue"); ?></option>
172
+ <option value="#008000"><?php _e("Green", "virtue"); ?></option>
173
+ <option value="#FFFF00"><?php _e("Yellow", "virtue"); ?></option>
174
+ <option value="#FFA500"><?php _e("Orange", "virtue"); ?></option>
175
+ <option value="#FF00FF"><?php _e("Pink", "virtue"); ?></option>
176
+ <option value="#800080"><?php _e("Purple", "virtue"); ?></option>
177
+ <option value="#8B4513"><?php _e("Brown", "virtue"); ?></option>
178
+ <option value="#800000"><?php _e("Maroon", "virtue"); ?></option>
179
+ </select>
180
+ </div>
181
+ <div>
182
+ <label class="hex" for="text-color-hex"><?php _e("Or Type Hex Color", "virtue"); ?></label>
183
+ <input type="text"class="btn-hex" name="text-color-hex" value="" id="text-hover-color-hex" />
184
+ </div>
185
+ </div>
186
+ <div class="linebreak">
187
+ <div>
188
+ <label for="btn-color"><?php _e("Button Background Hover Color", "virtue"); ?></label>
189
+ <select name="btn-color" id="btn-hover-color">
190
+ <option value=""><?php _e("30% Primary Color", "virtue"); ?></option>
191
+ <option value="#000"><?php _e("Black", "virtue"); ?></option>
192
+ <option value="#CDCDCD"><?php _e("Light-Gray", "virtue"); ?></option>
193
+ <option value="#999"><?php _e("Gray", "virtue"); ?></option>
194
+ <option value="#444"><?php _e("Dark-Gray", "virtue"); ?></option>
195
+ <option value="#CCC"><?php _e("Silver", "virtue"); ?></option>
196
+ <option value="#FFF"><?php _e("White", "virtue"); ?></option>
197
+ <option value="#F2F2F2"><?php _e("Off-White", "virtue"); ?></option>
198
+ <option value="#FF0000"><?php _e("Red", "virtue"); ?></option>
199
+ <option value="#0000FF"><?php _e("Blue", "virtue"); ?></option>
200
+ <option value="#008000"><?php _e("Green", "virtue"); ?></option>
201
+ <option value="#FFFF00"><?php _e("Yellow", "virtue"); ?></option>
202
+ <option value="#FFA500"><?php _e("Orange", "virtue"); ?></option>
203
+ <option value="#FF00FF"><?php _e("Pink", "virtue"); ?></option>
204
+ <option value="#800080"><?php _e("Purple", "virtue"); ?></option>
205
+ <option value="#8B4513"><?php _e("Brown", "virtue"); ?></option>
206
+ <option value="#800000"><?php _e("Maroon", "virtue"); ?></option>
207
+ </select>
208
+ </div>
209
+ <div>
210
+ <label class="hex" for="btn-color-hex"><?php _e("Or Type Hex Color", "virtue"); ?></label>
211
+ <input type="text" class="btn-hex" name="btn-color-hex" value="" id="btn-hover-color-hex" />
212
+ </div>
213
+ </div>
214
  <div class="linebreak">
215
  <div>
216
  <label for="btn-link"><?php _e("Button Link", "virtue"); ?></label>
virtue_toolkit.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Virtue / Pinnacle ToolKit
5
  Description: Custom Portfolio and Shortcode functionality for Virtue and Pinnacle Wordpress Theme
6
- Version: 1.9
7
  Author: Kadence Themes
8
  Author URI: http://kadencethemes.com/
9
  License: GPLv2 or later
@@ -17,6 +17,7 @@ function virtue_toolkit_deactivation() {
17
  register_deactivation_hook(__FILE__, 'virtue_toolkit_deactivation');
18
 
19
  require_once('post-types.php');
 
20
  require_once('shortcodes.php');
21
  require_once('shortcode_ajax.php');
22
 
3
  /*
4
  Plugin Name: Virtue / Pinnacle ToolKit
5
  Description: Custom Portfolio and Shortcode functionality for Virtue and Pinnacle Wordpress Theme
6
+ Version: 2.0
7
  Author: Kadence Themes
8
  Author URI: http://kadencethemes.com/
9
  License: GPLv2 or later
17
  register_deactivation_hook(__FILE__, 'virtue_toolkit_deactivation');
18
 
19
  require_once('post-types.php');
20
+ require_once('gallery.php');
21
  require_once('shortcodes.php');
22
  require_once('shortcode_ajax.php');
23