Version Description
- Update: add support for ascend
Download this release
Release Info
Developer | britner |
Plugin | Kadence Themes Toolkit |
Version | 4.0 |
Comparing to | |
See all releases |
Code changes from version 3.8 to 4.0
- gallery.php +464 -26
- metaboxes.php +259 -0
- readme.txt +4 -1
- shortcodes.php +77 -55
- shortcodes/icons/icon_popup.php +1 -1
- virtue_toolkit.php +2 -1
gallery.php
CHANGED
@@ -1,5 +1,282 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
function kt_toolkit_get_srcset($width,$height,$url,$id) {
|
4 |
if(empty($id) || empty($url)) {
|
5 |
return;
|
@@ -11,16 +288,18 @@ function kt_toolkit_get_srcset($width,$height,$url,$id) {
|
|
11 |
}
|
12 |
// If possible add in our images on the fly sizes
|
13 |
$ext = substr($image_meta['file'], strrpos($image_meta['file'], "."));
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
18 |
|
19 |
$upload_info = wp_upload_dir();
|
20 |
$upload_dir = $upload_info['basedir'];
|
21 |
|
22 |
$flyfile = trailingslashit($upload_dir).$pathflyfilename;
|
23 |
-
|
24 |
if(empty($image_meta['sizes']) ){ $image_meta['sizes'] = array();}
|
25 |
if (file_exists($flyfile)) {
|
26 |
$kt_add_imagesize = array(
|
@@ -34,19 +313,16 @@ function kt_toolkit_get_srcset($width,$height,$url,$id) {
|
|
34 |
$image_meta['sizes'] = array_merge($image_meta['sizes'], $kt_add_imagesize);
|
35 |
}
|
36 |
if (file_exists($retinafile)) {
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
$image_meta['sizes'] = array_merge($image_meta['sizes'], $kt_add_imagesize_retina);
|
48 |
-
}
|
49 |
-
}
|
50 |
if(function_exists ( 'wp_calculate_image_srcset') ){
|
51 |
$output = wp_calculate_image_srcset(array( $width, $height), $url, $image_meta, $id);
|
52 |
} else {
|
@@ -167,7 +443,7 @@ function kadence_shortcode_gallery($attr) {
|
|
167 |
$i = 0;
|
168 |
foreach ($attachments as $id => $attachment) {
|
169 |
$attachment_url = wp_get_attachment_url($id);
|
170 |
-
$image =
|
171 |
if(empty($image[0])) {$image = array($attachment_url,$imgsize,$imgsize);}
|
172 |
$img_srcset_output = kt_toolkit_get_srcset_output( $image[1], $image[2], $attachment_url, $id);
|
173 |
if($lightboxsize != 'full') {
|
@@ -194,11 +470,173 @@ function kadence_shortcode_gallery($attr) {
|
|
194 |
|
195 |
return $output;
|
196 |
}
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
}
|
1 |
<?php
|
2 |
|
3 |
+
if(!class_exists('KT_Toolkit_Aq_Resize')) {
|
4 |
+
class KT_Tool_Aq_Exception extends Exception {}
|
5 |
+
|
6 |
+
class KT_Toolkit_Aq_Resize
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* The singleton instance
|
10 |
+
*/
|
11 |
+
static private $instance = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Should an Aq_Exception be thrown on error?
|
15 |
+
* If false (default), then the error will just be logged.
|
16 |
+
*/
|
17 |
+
public $throwOnError = false;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* No initialization allowed
|
21 |
+
*/
|
22 |
+
private function __construct() {}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* No cloning allowed
|
26 |
+
*/
|
27 |
+
private function __clone() {}
|
28 |
+
|
29 |
+
static public function getInstance() {
|
30 |
+
if(self::$instance == null) {
|
31 |
+
self::$instance = new self;
|
32 |
+
}
|
33 |
+
|
34 |
+
return self::$instance;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Run, forest.
|
39 |
+
*/
|
40 |
+
public function process( $url, $width = null, $height = null, $crop = null, $single = true, $upscale = false ) {
|
41 |
+
try {
|
42 |
+
// Validate inputs.
|
43 |
+
if (!$url)
|
44 |
+
throw new KT_Tool_Aq_Exception('$url parameter is required');
|
45 |
+
|
46 |
+
// Caipt'n, ready to hook.
|
47 |
+
if ( true === $upscale ) add_filter( 'image_resize_dimensions', array($this, 'kt_tool_aq_upscale'), 10, 6 );
|
48 |
+
|
49 |
+
// Define upload path & dir.
|
50 |
+
$upload_info = wp_upload_dir();
|
51 |
+
$upload_dir = $upload_info['basedir'];
|
52 |
+
$upload_url = $upload_info['baseurl'];
|
53 |
+
|
54 |
+
$http_prefix = "http://";
|
55 |
+
$https_prefix = "https://";
|
56 |
+
$relative_prefix = "//"; // The protocol-relative URL
|
57 |
+
|
58 |
+
/* if the $url scheme differs from $upload_url scheme, make them match
|
59 |
+
if the schemes differe, images don't show up. */
|
60 |
+
if(!strncmp($url,$https_prefix,strlen($https_prefix))){ //if url begins with https:// make $upload_url begin with https:// as well
|
61 |
+
$upload_url = str_replace($http_prefix,$https_prefix,$upload_url);
|
62 |
+
}
|
63 |
+
elseif(!strncmp($url,$http_prefix,strlen($http_prefix))){ //if url begins with http:// make $upload_url begin with http:// as well
|
64 |
+
$upload_url = str_replace($https_prefix,$http_prefix,$upload_url);
|
65 |
+
}
|
66 |
+
elseif(!strncmp($url,$relative_prefix,strlen($relative_prefix))){ //if url begins with // make $upload_url begin with // as well
|
67 |
+
$upload_url = str_replace(array( 0 => "$http_prefix", 1 => "$https_prefix"),$relative_prefix,$upload_url);
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
// Check if $img_url is local.
|
72 |
+
if ( false === strpos( $url, $upload_url ) )
|
73 |
+
throw new KT_Tool_Aq_Exception('Image must be local: ' . $url);
|
74 |
+
|
75 |
+
// Define path of image.
|
76 |
+
$rel_path = str_replace( $upload_url, '', $url );
|
77 |
+
$img_path = $upload_dir . $rel_path;
|
78 |
+
|
79 |
+
// Check if img path exists, and is an image indeed.
|
80 |
+
if ( ! file_exists( $img_path ) or ! getimagesize( $img_path ) )
|
81 |
+
throw new KT_Tool_Aq_Exception('Image file does not exist (or is not an image): ' . $img_path);
|
82 |
+
|
83 |
+
// Get image info.
|
84 |
+
$info = pathinfo( $img_path );
|
85 |
+
$ext = $info['extension'];
|
86 |
+
list( $orig_w, $orig_h ) = getimagesize( $img_path );
|
87 |
+
|
88 |
+
// Get image size after cropping.
|
89 |
+
$dims = image_resize_dimensions( $orig_w, $orig_h, $width, $height, $crop );
|
90 |
+
$dst_w = $dims[4];
|
91 |
+
$dst_h = $dims[5];
|
92 |
+
|
93 |
+
// Return the original image only if it exactly fits the needed measures.
|
94 |
+
if ( ! $dims && ( ( ( null === $height && $orig_w == $width ) xor ( null === $width && $orig_h == $height ) ) xor ( $height == $orig_h && $width == $orig_w ) ) ) {
|
95 |
+
$img_url = $url;
|
96 |
+
$dst_w = $orig_w;
|
97 |
+
$dst_h = $orig_h;
|
98 |
+
} else {
|
99 |
+
// Use this to check if cropped image already exists, so we can return that instead.
|
100 |
+
$suffix = "{$dst_w}x{$dst_h}";
|
101 |
+
$dst_rel_path = str_replace( '.' . $ext, '', $rel_path );
|
102 |
+
$destfilename = "{$upload_dir}{$dst_rel_path}-{$suffix}.{$ext}";
|
103 |
+
|
104 |
+
if ( ! $dims || ( true == $crop && false == $upscale && ( $dst_w < $width || $dst_h < $height ) ) ) {
|
105 |
+
// Can't resize, so return false saying that the action to do could not be processed as planned.
|
106 |
+
throw new KT_Tool_Aq_Exception('Unable to resize image because image_resize_dimensions() failed');
|
107 |
+
}
|
108 |
+
// Else check if cache exists.
|
109 |
+
elseif ( file_exists( $destfilename ) && getimagesize( $destfilename ) ) {
|
110 |
+
$img_url = "{$upload_url}{$dst_rel_path}-{$suffix}.{$ext}";
|
111 |
+
}
|
112 |
+
// Else, we resize the image and return the new resized image url.
|
113 |
+
else {
|
114 |
+
|
115 |
+
$editor = wp_get_image_editor( $img_path );
|
116 |
+
|
117 |
+
if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) ) {
|
118 |
+
throw new KT_Tool_Aq_Exception('Unable to get WP_Image_Editor: (is GD or ImageMagick installed?)');
|
119 |
+
}
|
120 |
+
|
121 |
+
$resized_file = $editor->save();
|
122 |
+
|
123 |
+
if ( ! is_wp_error( $resized_file ) ) {
|
124 |
+
$resized_rel_path = str_replace( $upload_dir, '', $resized_file['path'] );
|
125 |
+
$img_url = $upload_url . $resized_rel_path;
|
126 |
+
} else {
|
127 |
+
throw new KT_Tool_Aq_Exception('Unable to save resized image file.');
|
128 |
+
}
|
129 |
+
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
// Okay, leave the ship.
|
134 |
+
if ( true === $upscale ) remove_filter( 'image_resize_dimensions', array( $this, 'kt_tool_aq_upscale' ) );
|
135 |
+
|
136 |
+
// Return the output.
|
137 |
+
if ( $single ) {
|
138 |
+
// str return.
|
139 |
+
$image = $img_url;
|
140 |
+
} else {
|
141 |
+
// array return.
|
142 |
+
$image = array (
|
143 |
+
0 => $img_url,
|
144 |
+
1 => $dst_w,
|
145 |
+
2 => $dst_h
|
146 |
+
);
|
147 |
+
}
|
148 |
+
|
149 |
+
// RETINA Support --------------------------------------------------------------->
|
150 |
+
if ( apply_filters( 'kadence_retina_support', true ) ) :
|
151 |
+
$retina_w = $dst_w*2;
|
152 |
+
$retina_h = $dst_h*2;
|
153 |
+
|
154 |
+
//get image size after cropping
|
155 |
+
$dims_x2 = image_resize_dimensions($orig_w, $orig_h, $retina_w, $retina_h, $crop);
|
156 |
+
$dst_x2_w = $dims_x2[4];
|
157 |
+
$dst_x2_h = $dims_x2[5];
|
158 |
+
|
159 |
+
// If possible lets make the @2x image
|
160 |
+
if($dst_x2_h) {
|
161 |
+
|
162 |
+
if (true == $crop && ( $dst_x2_w < $retina_w || $dst_x2_h < $retina_h ) ) {
|
163 |
+
// do nothing
|
164 |
+
} else {
|
165 |
+
|
166 |
+
$x2suffix = "{$dst_x2_w}x{$dst_x2_h}";
|
167 |
+
//@2x image url
|
168 |
+
$destfilename = "{$upload_dir}{$dst_rel_path}-{$x2suffix}.{$ext}";
|
169 |
+
|
170 |
+
//check if retina image exists
|
171 |
+
if(file_exists($destfilename) && getimagesize($destfilename)) {
|
172 |
+
// already exists, do nothing
|
173 |
+
} else {
|
174 |
+
// doesnt exist, lets create it
|
175 |
+
$editor = wp_get_image_editor($img_path);
|
176 |
+
if ( ! is_wp_error( $editor ) ) {
|
177 |
+
$editor->resize( $retina_w, $retina_h, true );
|
178 |
+
$editor = $editor->save();
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
}
|
184 |
+
endif;
|
185 |
+
|
186 |
+
return $image;
|
187 |
+
}
|
188 |
+
catch (KT_Tool_Aq_Exception $ex) {
|
189 |
+
//error_log('Aq_Resize.process() error: ' . $ex->getMessage());
|
190 |
+
|
191 |
+
if ($this->throwOnError) {
|
192 |
+
// Bubble up exception.
|
193 |
+
throw $ex;
|
194 |
+
}
|
195 |
+
else {
|
196 |
+
// Return false, so that this patch is backwards-compatible.
|
197 |
+
return false;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Callback to overwrite WP computing of thumbnail measures
|
204 |
+
*/
|
205 |
+
function kt_tool_aq_upscale( $default, $orig_w, $orig_h, $dest_w, $dest_h, $crop ) {
|
206 |
+
if ( ! $crop ) return null; // Let the wordpress default function handle this.
|
207 |
+
|
208 |
+
// Here is the point we allow to use larger image size than the original one.
|
209 |
+
$aspect_ratio = $orig_w / $orig_h;
|
210 |
+
$new_w = $dest_w;
|
211 |
+
$new_h = $dest_h;
|
212 |
+
|
213 |
+
if ( ! $new_w ) {
|
214 |
+
$new_w = intval( $new_h * $aspect_ratio );
|
215 |
+
}
|
216 |
+
|
217 |
+
if ( ! $new_h ) {
|
218 |
+
$new_h = intval( $new_w / $aspect_ratio );
|
219 |
+
}
|
220 |
+
|
221 |
+
$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );
|
222 |
+
|
223 |
+
$crop_w = round( $new_w / $size_ratio );
|
224 |
+
$crop_h = round( $new_h / $size_ratio );
|
225 |
+
|
226 |
+
$s_x = floor( ( $orig_w - $crop_w ) / 2 );
|
227 |
+
$s_y = floor( ( $orig_h - $crop_h ) / 2 );
|
228 |
+
|
229 |
+
return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );
|
230 |
+
}
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
237 |
+
|
238 |
+
if(!function_exists('kt_toolkit_aq_resize')) {
|
239 |
+
function kt_toolkit_aq_resize( $url, $width = null, $height = null, $crop = null, $single = true, $upscale = false, $id = null ) {
|
240 |
+
if( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
|
241 |
+
if(empty($height) ) {
|
242 |
+
$args = array( 'w' => $width );
|
243 |
+
if(!empty($id)) {
|
244 |
+
$image_attributes = wp_get_attachment_image_src ( $id, 'full' );
|
245 |
+
$sizes = image_resize_dimensions($image_attributes[1], $image_attributes[2], $width, null, false );
|
246 |
+
$height = $sizes[5];
|
247 |
+
} else {
|
248 |
+
$height = null;
|
249 |
+
}
|
250 |
+
} else if(empty($width) ) {
|
251 |
+
$args = array( 'h' => $height );
|
252 |
+
if(!empty($id)) {
|
253 |
+
$image_attributes = wp_get_attachment_image_src ( $id, 'full' );
|
254 |
+
$sizes = image_resize_dimensions($image_attributes[1], $image_attributes[2], null, $height, false );
|
255 |
+
$width = $sizes[4];
|
256 |
+
} else {
|
257 |
+
$width = null;
|
258 |
+
}
|
259 |
+
} else {
|
260 |
+
$args = array( 'resize' => $width . ',' . $height );
|
261 |
+
}
|
262 |
+
if ( $single ) {
|
263 |
+
// str return.
|
264 |
+
$image = jetpack_photon_url( $url, $args );
|
265 |
+
} else {
|
266 |
+
// array return.
|
267 |
+
$image = array (
|
268 |
+
0 => jetpack_photon_url( $url, $args ),
|
269 |
+
1 => $width,
|
270 |
+
2 => $height
|
271 |
+
);
|
272 |
+
}
|
273 |
+
return $image;
|
274 |
+
} else {
|
275 |
+
$kt_tool_aq_resize = KT_Toolkit_Aq_Resize::getInstance();
|
276 |
+
return $kt_tool_aq_resize->process( $url, $width, $height, $crop, $single, $upscale );
|
277 |
+
}
|
278 |
+
}
|
279 |
+
}
|
280 |
function kt_toolkit_get_srcset($width,$height,$url,$id) {
|
281 |
if(empty($id) || empty($url)) {
|
282 |
return;
|
288 |
}
|
289 |
// If possible add in our images on the fly sizes
|
290 |
$ext = substr($image_meta['file'], strrpos($image_meta['file'], "."));
|
291 |
+
$pathflyfilename = str_replace($ext,'-'.$width.'x'.$height.'' . $ext, $image_meta['file']);
|
292 |
+
$retina_w = $width*2;
|
293 |
+
$retina_h = $height*2;
|
294 |
+
$pathretinaflyfilename = str_replace($ext, '-'.$retina_w.'x'.$retina_h.'' . $ext, $image_meta['file']);
|
295 |
+
$flyfilename = basename($image_meta['file'], $ext) . '-'.$width.'x'.$height.'' . $ext;
|
296 |
+
$retinaflyfilename = basename($image_meta['file'], $ext) . '-'.$retina_w.'x'.$retina_h.'' . $ext;
|
297 |
|
298 |
$upload_info = wp_upload_dir();
|
299 |
$upload_dir = $upload_info['basedir'];
|
300 |
|
301 |
$flyfile = trailingslashit($upload_dir).$pathflyfilename;
|
302 |
+
$retinafile = trailingslashit($upload_dir).$pathretinaflyfilename;
|
303 |
if(empty($image_meta['sizes']) ){ $image_meta['sizes'] = array();}
|
304 |
if (file_exists($flyfile)) {
|
305 |
$kt_add_imagesize = array(
|
313 |
$image_meta['sizes'] = array_merge($image_meta['sizes'], $kt_add_imagesize);
|
314 |
}
|
315 |
if (file_exists($retinafile)) {
|
316 |
+
$kt_add_imagesize_retina = array(
|
317 |
+
'kt_on_fly_retina' => array(
|
318 |
+
'file'=> $retinaflyfilename,
|
319 |
+
'width' => $retina_w,
|
320 |
+
'height' => $retina_h,
|
321 |
+
'mime-type' => isset($image_meta['sizes']['thumbnail']) ? $image_meta['sizes']['thumbnail']['mime-type'] : '',
|
322 |
+
)
|
323 |
+
);
|
324 |
+
$image_meta['sizes'] = array_merge($image_meta['sizes'], $kt_add_imagesize_retina);
|
325 |
+
}
|
|
|
|
|
|
|
326 |
if(function_exists ( 'wp_calculate_image_srcset') ){
|
327 |
$output = wp_calculate_image_srcset(array( $width, $height), $url, $image_meta, $id);
|
328 |
} else {
|
443 |
$i = 0;
|
444 |
foreach ($attachments as $id => $attachment) {
|
445 |
$attachment_url = wp_get_attachment_url($id);
|
446 |
+
$image = kt_toolkit_aq_resize($attachment_url, $imgsize, $imgsize, true, false, false, $id);
|
447 |
if(empty($image[0])) {$image = array($attachment_url,$imgsize,$imgsize);}
|
448 |
$img_srcset_output = kt_toolkit_get_srcset_output( $image[1], $image[2], $attachment_url, $id);
|
449 |
if($lightboxsize != 'full') {
|
470 |
|
471 |
return $output;
|
472 |
}
|
473 |
+
add_action('init', 'kt_tool_gallery_setup_init');
|
474 |
+
function kt_tool_gallery_setup_init() {
|
475 |
+
$pinnacle = get_option( 'pinnacle' );
|
476 |
+
$virtue = get_option( 'virtue' );
|
477 |
+
if(! function_exists( 'kadence_gallery' ) ) {
|
478 |
+
if( (isset($pinnacle['pinnacle_gallery']) && $pinnacle['pinnacle_gallery'] == '1') || (isset($virtue['virtue_gallery']) && $virtue['virtue_gallery'] == '1') ) {
|
479 |
+
remove_shortcode('gallery');
|
480 |
+
add_shortcode('gallery', 'kadence_shortcode_gallery');
|
481 |
+
}
|
482 |
+
}
|
483 |
+
}
|
484 |
+
function kt_toolkit_shortcode_gallery($attr) {
|
485 |
+
$post = get_post();
|
486 |
+
static $instance = 0;
|
487 |
+
$instance++;
|
488 |
+
|
489 |
+
if (!empty($attr['ids'])) {
|
490 |
+
if (empty($attr['orderby'])) {
|
491 |
+
$attr['orderby'] = 'post__in';
|
492 |
+
}
|
493 |
+
$attr['include'] = $attr['ids'];
|
494 |
+
}
|
495 |
+
|
496 |
+
$output = apply_filters('post_gallery', '', $attr);
|
497 |
+
|
498 |
+
if ($output != '') {
|
499 |
+
return $output;
|
500 |
+
}
|
501 |
+
|
502 |
+
if (isset($attr['orderby'])) {
|
503 |
+
$attr['orderby'] = sanitize_sql_orderby($attr['orderby']);
|
504 |
+
if (!$attr['orderby']) {
|
505 |
+
unset($attr['orderby']);
|
506 |
+
}
|
507 |
+
}
|
508 |
+
if(!isset($post)) {
|
509 |
+
$post_id = null;
|
510 |
+
} else {
|
511 |
+
$post_id = $post->ID;
|
512 |
+
}
|
513 |
+
|
514 |
+
extract(shortcode_atts(array(
|
515 |
+
'order' => 'ASC',
|
516 |
+
'orderby' => 'menu_order ID',
|
517 |
+
'id' => $post_id,
|
518 |
+
'columns' => 3,
|
519 |
+
'link' => 'file',
|
520 |
+
'size' => 'full',
|
521 |
+
'include' => '',
|
522 |
+
'use_image_alt' => 'true',
|
523 |
+
'gallery_id' => (rand(10,100)),
|
524 |
+
'lightboxsize' => 'full',
|
525 |
+
'exclude' => ''
|
526 |
+
), $attr));
|
527 |
+
|
528 |
+
$id = intval($id);
|
529 |
+
|
530 |
+
if ($order === 'RAND') {
|
531 |
+
$orderby = 'none';
|
532 |
+
}
|
533 |
+
$caption = 'false';
|
534 |
+
if (!empty($include)) {
|
535 |
+
$_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
|
536 |
+
$attachments = array();
|
537 |
+
foreach ($_attachments as $key => $val) {
|
538 |
+
$attachments[$val->ID] = $_attachments[$key];
|
539 |
+
}
|
540 |
+
} elseif (!empty($exclude)) {
|
541 |
+
$attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
|
542 |
+
} else {
|
543 |
+
$attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
|
544 |
+
}
|
545 |
+
if (empty($attachments)) {
|
546 |
+
return '';
|
547 |
+
}
|
548 |
+
if (is_feed()) {
|
549 |
+
$output = "\n";
|
550 |
+
foreach ($attachments as $att_id => $attachment) {
|
551 |
+
$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
|
552 |
+
}
|
553 |
+
return $output;
|
554 |
+
}
|
555 |
+
$output .= '<div id="kad-wp-gallery'.esc_attr($gallery_id).'" class="kad-wp-gallery kt-gallery-column-'.esc_attr($columns).' kad-light-gallery clearfix row-margin-small">';
|
556 |
+
if ($columns == '1') {
|
557 |
+
$itemsize = 'col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12 col-ss-12';
|
558 |
+
$imgsize = 1140;
|
559 |
+
} else if ($columns == '2') {
|
560 |
+
$itemsize = 'col-xxl-3 col-xl-4 col-lg-6 col-md-6 col-sm-6 col-xs-12 col-ss-12';
|
561 |
+
$imgsize = 600;
|
562 |
+
} else if ($columns == '3'){
|
563 |
+
$itemsize = 'col-xxl-25 col-xl-3 col-lg-4 col-md-4 col-sm-4 col-xs-6 col-ss-12';
|
564 |
+
$imgsize = 400;
|
565 |
+
} else if ($columns == '4'){
|
566 |
+
$itemsize = 'col-xxl-2 col-xl-25 col-lg-3 col-md-3 col-sm-4 col-xs-6 col-ss-12';
|
567 |
+
$imgsize = 300;
|
568 |
+
} else if ($columns == '5'){
|
569 |
+
$itemsize = 'col-xxl-2 col-xl-2 col-lg-25 col-md-25 col-sm-3 col-xs-4 col-ss-6';
|
570 |
+
$imgsize = 240;
|
571 |
+
} else if ($columns == '6'){
|
572 |
+
$itemsize = 'col-xxl-15 col-xl-2 col-lg-2 col-md-2 col-sm-3 col-xs-4 col-ss-6';
|
573 |
+
$imgsize = 240;
|
574 |
+
} else {
|
575 |
+
$itemsize = 'col-xxl-1 col-xl-15 col-lg-2 col-md-2 col-sm-3 col-xs-4 col-ss-4';
|
576 |
+
$imgsize = 240;
|
577 |
+
}
|
578 |
+
|
579 |
+
$i = 0;
|
580 |
+
foreach ($attachments as $id => $attachment) {
|
581 |
+
$attachment_src = wp_get_attachment_image_src($id, 'full');
|
582 |
+
$attachment_url = $attachment_src[0];
|
583 |
+
|
584 |
+
$image = kt_toolkit_aq_resize($attachment_src[0], $imgsize, $imgsize, true, false, false, $id);
|
585 |
+
|
586 |
+
if(empty($image[0])) {
|
587 |
+
$image = $attachment_src[0];
|
588 |
+
}
|
589 |
+
$img_srcset_output = kt_toolkit_get_srcset_output( $image[1], $image[2], $attachment_url, $id);
|
590 |
+
if($lightboxsize != 'full') {
|
591 |
+
$attachment_lb = wp_get_attachment_image_src( $id, $lightboxsize);
|
592 |
+
$attachment_url = $attachment_lb[0];
|
593 |
+
}
|
594 |
+
$lightbox_data = 'data-rel="lightbox"';
|
595 |
+
if($link == 'attachment_page') {
|
596 |
+
$attachment_url = get_permalink($id);
|
597 |
+
$lightbox_data = '';
|
598 |
+
}
|
599 |
+
// Get alt or caption for alt
|
600 |
+
if($use_image_alt == 'true') {
|
601 |
+
$alt = get_post_meta($id, '_wp_attachment_image_alt', true);
|
602 |
+
} else {
|
603 |
+
$alt = $attachment->post_excerpt;
|
604 |
+
}
|
605 |
+
|
606 |
+
$paddingbtn = ($image[2]/$image[1]) * 100;
|
607 |
+
$output .= '<div class="'.$itemsize.' g_item"><div class="grid_item gallery_item">';
|
608 |
+
if($link != 'none') {
|
609 |
+
$output .='<a href="'.esc_url($attachment_url).'" '.$lightbox_data.' class="gallery-link">';
|
610 |
+
}
|
611 |
+
$output .= '<div class="kt-intrinsic" style="padding-bottom:'.$paddingbtn.'%;" itemprop="image" itemscope itemtype="http://schema.org/ImageObject">';
|
612 |
+
$output .= '<img src="'.esc_url($image[0]).'" width="'.esc_attr($image[1]).'" height="'.esc_attr($image[2]).'" alt="'.esc_attr($alt).'" '.$img_srcset_output.' itemprop="contentUrl" class="kt-gallery-img"/>';
|
613 |
+
$output .= '<meta itemprop="url" content="'.esc_url($image[0]).'">';
|
614 |
+
$output .= '<meta itemprop="width" content="'.esc_attr($image[1]).'">';
|
615 |
+
$output .= '<meta itemprop="height" content="'.esc_attr($image[2]).'>">';
|
616 |
+
$output .= '</div>';
|
617 |
+
if (trim($attachment->post_excerpt) && $caption == 'true') {
|
618 |
+
$output .= '<div class="photo-caption-bg"></div>';
|
619 |
+
$output .= '<div class="caption kad_caption">';
|
620 |
+
$output .= '<div class="kad_caption_inner">' . wptexturize($attachment->post_excerpt) . '</div>';
|
621 |
+
$output .= '</div>';
|
622 |
+
}
|
623 |
+
if($link != 'none') {
|
624 |
+
$output .= '</a>';
|
625 |
+
}
|
626 |
+
$output .= '</div></div>';
|
627 |
+
}
|
628 |
+
$output .= '</div>';
|
629 |
+
|
630 |
+
return $output;
|
631 |
+
}
|
632 |
+
add_action('init', 'kt_tool_ascend_gallery_setup_init');
|
633 |
+
function kt_tool_ascend_gallery_setup_init() {
|
634 |
+
$the_theme = wp_get_theme();
|
635 |
+
if($the_theme->get( 'Name' ) == 'Ascend' || ($the_theme->get( 'Template') == 'ascend') ) {
|
636 |
+
$ascend = get_option( 'ascend' );
|
637 |
+
if(isset($ascend['kadence_gallery']) && $ascend['kadence_gallery'] == '1') {
|
638 |
+
remove_shortcode('gallery');
|
639 |
+
add_shortcode('gallery', 'kt_toolkit_shortcode_gallery');
|
640 |
+
}
|
641 |
+
}
|
642 |
}
|
metaboxes.php
CHANGED
@@ -1144,4 +1144,263 @@ function initialize_kadence_toolkit_meta_boxes() {
|
|
1144 |
require_once 'cmb/init.php';
|
1145 |
}
|
1146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1147 |
}
|
1144 |
require_once 'cmb/init.php';
|
1145 |
}
|
1146 |
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
function kt_toolkit_ascend_gallery_field( $field, $meta ) {
|
1150 |
+
echo '<div class="kad-gallery kad_widget_image_gallery">';
|
1151 |
+
echo '<div class="gallery_images">';
|
1152 |
+
$attachments = array_filter( explode( ',', $meta ) );
|
1153 |
+
if ( $attachments ) :
|
1154 |
+
foreach ( $attachments as $attachment_id ) {
|
1155 |
+
$img = wp_get_attachment_image_src($attachment_id, 'thumbnail');
|
1156 |
+
$imgfull = wp_get_attachment_image_src($attachment_id, 'full');
|
1157 |
+
echo '<a class="of-uploaded-image edit-kt-meta-gal" data-attachment-id="'.esc_attr($attachment_id).'" href="#">';
|
1158 |
+
echo '<img class="gallery-widget-image" id="gallery_widget_image_'.esc_attr($attachment_id). '" src="' . esc_url($img[0]) . '" width="'.esc_attr($img[1]).'" height="'.esc_attr($img[2]).'" />';
|
1159 |
+
echo '</a>';
|
1160 |
+
}
|
1161 |
+
endif;
|
1162 |
+
echo '</div>';
|
1163 |
+
echo ' <input type="hidden" id="' . esc_attr($field->args( 'id' )) . '" name="' . esc_attr($field->args( 'id' )) . '" class="gallery_values" value="' . esc_attr($meta) . '" />';
|
1164 |
+
echo '<a href="#" onclick="return false;" id="edit-gallery" class="gallery-attachments button button-primary">' . __('Add/Edit Gallery', 'virtue-toolkit') . '</a>';
|
1165 |
+
echo '<a href="#" onclick="return false;" id="clear-gallery" class="gallery-attachments button">' . __('Clear Gallery', 'virtue-toolkit') . '</a>';
|
1166 |
+
echo '</div>';
|
1167 |
+
$desc = $field->args('desc');
|
1168 |
+
if ( !empty( $desc)) {
|
1169 |
+
echo '<p class="cmb_metabox_description">' . $field->args( 'desc' ) . '</p>';
|
1170 |
+
}
|
1171 |
+
}
|
1172 |
+
add_filter( 'cmb2_render_kad_gallery', 'kt_toolkit_ascend_gallery_field', 10, 2 );
|
1173 |
+
|
1174 |
+
add_filter( 'cmb2_admin_init', 'kt_toolkit_ascend_metabox');
|
1175 |
+
function kt_toolkit_ascend_metabox() {
|
1176 |
+
$prefix = '_kad_';
|
1177 |
+
// GALLERY POST
|
1178 |
+
$kt_gallery_post = new_cmb2_box( array(
|
1179 |
+
'id' => 'gallery_post_metabox',
|
1180 |
+
'title' => __("Gallery Post Options", 'virtue-toolkit'),
|
1181 |
+
'object_types' => array( 'post'),
|
1182 |
+
'priority' => 'high',
|
1183 |
+
) );
|
1184 |
+
|
1185 |
+
$kt_gallery_post->add_field( array(
|
1186 |
+
'name' => __("Post Head Content", 'virtue-toolkit' ),
|
1187 |
+
'desc' => '',
|
1188 |
+
'id' => $prefix . 'gallery_blog_head',
|
1189 |
+
'type' => 'select',
|
1190 |
+
'options' => array(
|
1191 |
+
'default' => __("Gallery Post Default", 'virtue-toolkit' ),
|
1192 |
+
'flex' => __("Image Slider - (Cropped Image Ratio)", 'virtue-toolkit' ),
|
1193 |
+
'carouselslider' => __("Image Slider - (Different Image Ratio)", 'virtue-toolkit' ),
|
1194 |
+
'thumbslider' => __("Image Slider with thumbnails - (Cropped Image Ratio)", 'virtue-toolkit' ),
|
1195 |
+
'imgcarousel' => __("Image Carousel - (Muiltiple Images Showing At Once)", 'virtue-toolkit' ),
|
1196 |
+
'gallery' => __("Image Collage - (Use 2 to 5 images)", 'virtue-toolkit' ),
|
1197 |
+
'shortcode' => __("Shortcode", 'virtue-toolkit' ),
|
1198 |
+
'none' => __("None", 'virtue-toolkit' ),
|
1199 |
+
),
|
1200 |
+
) );
|
1201 |
+
$kt_gallery_post->add_field( array(
|
1202 |
+
'name' => __("Post Slider Gallery", 'virtue-toolkit' ),
|
1203 |
+
'desc' => __("Add images for gallery here - Use large images", 'virtue-toolkit' ),
|
1204 |
+
'id' => $prefix . 'image_gallery',
|
1205 |
+
'type' => 'kad_gallery',
|
1206 |
+
) );
|
1207 |
+
|
1208 |
+
$kt_gallery_post->add_field( array(
|
1209 |
+
'name' => __('Gallery Post Shortcode', 'virtue-toolkit'),
|
1210 |
+
'desc' => __('If using shortcode place here.', 'virtue-toolkit'),
|
1211 |
+
'id' => $prefix . 'post_gallery_shortcode',
|
1212 |
+
'type' => 'textarea_code',
|
1213 |
+
) );
|
1214 |
+
$kt_gallery_post->add_field( array(
|
1215 |
+
'name' => __("Max Slider/Image Height", 'virtue-toolkit' ),
|
1216 |
+
'desc' => __("Note: just input number, example: 350", 'virtue-toolkit' ),
|
1217 |
+
'id' => $prefix . 'gallery_posthead_height',
|
1218 |
+
'type' => 'text_small',
|
1219 |
+
) );
|
1220 |
+
$kt_gallery_post->add_field( array(
|
1221 |
+
'name' => __("Max Slider/Image Width", 'virtue-toolkit' ),
|
1222 |
+
'desc' => __("Note: just input number, example: 650", 'virtue-toolkit' ),
|
1223 |
+
'id' => $prefix . 'gallery_posthead_width',
|
1224 |
+
'type' => 'text_small',
|
1225 |
+
) );
|
1226 |
+
$kt_gallery_post->add_field( array(
|
1227 |
+
'name' => __("Post Summary", 'virtue-toolkit' ),
|
1228 |
+
'desc' => '',
|
1229 |
+
'id' => $prefix . 'gallery_post_summery',
|
1230 |
+
'type' => 'select',
|
1231 |
+
'options' => array(
|
1232 |
+
'default' => __('Gallery Post Default', 'virtue-toolkit' ),
|
1233 |
+
'img_portrait' => __('Portrait Image (feature image)', 'virtue-toolkit'),
|
1234 |
+
'img_landscape' => __('Landscape Image (feature image)', 'virtue-toolkit'),
|
1235 |
+
'slider_portrait' => __('Portrait Image Slider', 'virtue-toolkit'),
|
1236 |
+
'slider_landscape' => __('Landscape Image Slider', 'virtue-toolkit'),
|
1237 |
+
'gallery_grid' => __('Photo Collage - (Use 2 to 5 images)', 'virtue-toolkit'),
|
1238 |
+
),
|
1239 |
+
) );
|
1240 |
+
// VIDEO POST
|
1241 |
+
$kt_video_post = new_cmb2_box( array(
|
1242 |
+
'id' => 'video_post_metabox',
|
1243 |
+
'title' => __("Video Post Options", 'virtue-toolkit'),
|
1244 |
+
'object_types' => array( 'post'),
|
1245 |
+
'priority' => 'high',
|
1246 |
+
) );
|
1247 |
+
$kt_video_post->add_field( array(
|
1248 |
+
'name' => __("Post Head Content", 'virtue-toolkit' ),
|
1249 |
+
'desc' => '',
|
1250 |
+
'id' => $prefix . 'video_blog_head',
|
1251 |
+
'type' => 'select',
|
1252 |
+
'options' => array(
|
1253 |
+
'default' => __("Video Post Default", 'virtue-toolkit' ),
|
1254 |
+
'video' => __("Video", 'virtue-toolkit' ),
|
1255 |
+
'none' => __("None", 'virtue-toolkit' ),
|
1256 |
+
),
|
1257 |
+
) );
|
1258 |
+
|
1259 |
+
$kt_video_post->add_field( array(
|
1260 |
+
'name' => __('Video post embed', 'virtue-toolkit'),
|
1261 |
+
'desc' => __('Place url, embed code or shortcode, works with youtube, vimeo. (Use the featured image for screen shot)', 'virtue-toolkit'),
|
1262 |
+
'id' => $prefix . 'post_video',
|
1263 |
+
'type' => 'textarea_code',
|
1264 |
+
) );
|
1265 |
+
$kt_video_post->add_field( array(
|
1266 |
+
'name' => __("Video Meta Title", 'virtue-toolkit' ),
|
1267 |
+
'desc' => __("Used for SEO purposes", 'virtue-toolkit' ),
|
1268 |
+
'id' => $prefix . 'video_meta_title',
|
1269 |
+
'type' => 'text',
|
1270 |
+
) );
|
1271 |
+
$kt_video_post->add_field( array(
|
1272 |
+
'name' => __("Video Meta description", 'virtue-toolkit' ),
|
1273 |
+
'desc' => __("Used for SEO purposes", 'virtue-toolkit' ),
|
1274 |
+
'id' => $prefix . 'video_meta_description',
|
1275 |
+
'type' => 'text',
|
1276 |
+
) );
|
1277 |
+
$kt_video_post->add_field( array(
|
1278 |
+
'name' => __("Max Video Width", 'virtue-toolkit' ),
|
1279 |
+
'desc' => __("Note: just input number, example: 650", 'virtue-toolkit' ),
|
1280 |
+
'id' => $prefix . 'video_posthead_width',
|
1281 |
+
'type' => 'text_small',
|
1282 |
+
) );
|
1283 |
+
$kt_video_post->add_field( array(
|
1284 |
+
'name' => __("Post Summary", 'virtue-toolkit' ),
|
1285 |
+
'desc' => '',
|
1286 |
+
'id' => $prefix . 'video_post_summery',
|
1287 |
+
'type' => 'select',
|
1288 |
+
'options' => array(
|
1289 |
+
'default' => __('Video Post Default', 'virtue-toolkit' ),
|
1290 |
+
'video' => __('Video - (when possible)', 'virtue-toolkit'),
|
1291 |
+
'img_portrait' => __('Portrait Image (feature image)', 'virtue-toolkit'),
|
1292 |
+
'img_landscape' => __('Landscape Image (feature image)', 'virtue-toolkit'),
|
1293 |
+
),
|
1294 |
+
) );
|
1295 |
+
// Quote
|
1296 |
+
$kt_quote_post = new_cmb2_box( array(
|
1297 |
+
'id' => 'quote_post_metabox',
|
1298 |
+
'title' => __("Quote Post Options", 'virtue-toolkit'),
|
1299 |
+
'object_types' => array( 'post'),
|
1300 |
+
'priority' => 'high',
|
1301 |
+
) );
|
1302 |
+
$kt_quote_post->add_field( array(
|
1303 |
+
'name' => __("Quote author", 'virtue-toolkit' ),
|
1304 |
+
'id' => $prefix . 'quote_author',
|
1305 |
+
'type' => 'text',
|
1306 |
+
) );
|
1307 |
+
|
1308 |
+
// Portfolio
|
1309 |
+
$kt_portfolio_post = new_cmb2_box( array(
|
1310 |
+
'id' => 'portfolio_post_metabox',
|
1311 |
+
'title' => __("Portfolio Options", 'virtue-toolkit'),
|
1312 |
+
'object_types' => array('portfolio'),
|
1313 |
+
'priority' => 'high',
|
1314 |
+
) );
|
1315 |
+
$kt_portfolio_post->add_field( array(
|
1316 |
+
'name' => __('Project Layout', 'virtue-toolkit'),
|
1317 |
+
'desc' => '',
|
1318 |
+
'id' => $prefix . 'ppost_layout',
|
1319 |
+
'type' => 'radio_inline',
|
1320 |
+
'options' => array(
|
1321 |
+
'default' => __("Default", 'virtue-toolkit' ),
|
1322 |
+
'beside' => __("Beside 40%", 'virtue-toolkit' ),
|
1323 |
+
'besidesmall' => __("Beside 33%", 'virtue-toolkit' ),
|
1324 |
+
'above' => __("Above", 'virtue-toolkit' ),
|
1325 |
+
),
|
1326 |
+
) );
|
1327 |
+
$kt_portfolio_post->add_field( array(
|
1328 |
+
'name' => __('Project Options', 'virtue-toolkit'),
|
1329 |
+
'desc' => '',
|
1330 |
+
'id' => $prefix . 'ppost_type',
|
1331 |
+
'type' => 'select',
|
1332 |
+
'options' => array(
|
1333 |
+
'image' => __("Image", 'virtue-toolkit' ),
|
1334 |
+
'flex' => __("Image Slider (Cropped Image Ratio)", 'virtue-toolkit' ),
|
1335 |
+
'carouselslider' => __("Image Slider - (Different Image Ratio)", 'virtue-toolkit' ),
|
1336 |
+
'thumbslider' => __("Image Slider with thumbnails (Cropped Image Ratio)", 'virtue-toolkit' ),
|
1337 |
+
'imgcarousel' => __("Image Carousel - (Muiltiple Images Showing At Once)", 'virtue-toolkit' ),
|
1338 |
+
'collage' => __("Image Collage - (Use 2 to 5 images)", 'virtue-toolkit' ),
|
1339 |
+
'video' => __("Video", 'virtue-toolkit' ),
|
1340 |
+
'none' => __("None", 'virtue-toolkit' ),
|
1341 |
+
),
|
1342 |
+
) );
|
1343 |
+
$kt_portfolio_post->add_field( array(
|
1344 |
+
'name' => __('Columns', 'virtue-toolkit'),
|
1345 |
+
'desc' => '',
|
1346 |
+
'id' => $prefix . 'portfolio_img_grid_columns',
|
1347 |
+
'type' => 'select',
|
1348 |
+
'default' => '3',
|
1349 |
+
'options' => array(
|
1350 |
+
'2' => __("Two Columns", 'virtue-toolkit' ),
|
1351 |
+
'3' => __("Three Columns", 'virtue-toolkit' ),
|
1352 |
+
'4' => __("Four Columns", 'virtue-toolkit' ),
|
1353 |
+
'5' => __("Five Columns", 'virtue-toolkit' ),
|
1354 |
+
'6' => __("Six Columns", 'virtue-toolkit' ),
|
1355 |
+
),
|
1356 |
+
) );
|
1357 |
+
$kt_portfolio_post->add_field( array(
|
1358 |
+
'name' => __("Portfolio Image Gallery", 'virtue-toolkit' ),
|
1359 |
+
'desc' => __("Add images for gallery here - Use large images", 'virtue-toolkit' ),
|
1360 |
+
'id' => $prefix . 'image_gallery',
|
1361 |
+
'type' => 'kad_gallery',
|
1362 |
+
) );
|
1363 |
+
$kt_portfolio_post->add_field( array(
|
1364 |
+
'name' => __('Video embed', 'virtue-toolkit'),
|
1365 |
+
'desc' => __('Place url, embed code or shortcode, works with youtube, vimeo. (Use the featured image for screen shot)', 'virtue-toolkit'),
|
1366 |
+
'id' => $prefix . 'post_video',
|
1367 |
+
'type' => 'textarea_code',
|
1368 |
+
) );
|
1369 |
+
$kt_portfolio_post->add_field( array(
|
1370 |
+
'name' => __("Max Slider/Image Width", 'virtue-toolkit' ),
|
1371 |
+
'desc' => __("Note: just input number, example: 650", 'virtue-toolkit' ),
|
1372 |
+
'id' => $prefix . 'portfolio_slider_width',
|
1373 |
+
'type' => 'text_small',
|
1374 |
+
) );
|
1375 |
+
$kt_portfolio_post->add_field( array(
|
1376 |
+
'name' => __("Max Slider/Image Height", 'virtue-toolkit' ),
|
1377 |
+
'desc' => __("Note: just input number, example: 350", 'virtue-toolkit' ),
|
1378 |
+
'id' => $prefix . 'portfolio_slider_height',
|
1379 |
+
'type' => 'text_small',
|
1380 |
+
) );
|
1381 |
+
// Portfolio Carousel
|
1382 |
+
$kt_portfolio_carousel = new_cmb2_box( array(
|
1383 |
+
'id' => 'portfolio_post_carousel_metabox',
|
1384 |
+
'title' => __("Portfolio Bottom Carousel Options", 'virtue-toolkit'),
|
1385 |
+
'object_types' => array('portfolio'),
|
1386 |
+
'priority' => 'high',
|
1387 |
+
) );
|
1388 |
+
$kt_portfolio_carousel->add_field( array(
|
1389 |
+
'name' => __('Carousel Title', 'virtue-toolkit'),
|
1390 |
+
'desc' => __('ex. Similar Projects', 'virtue-toolkit'),
|
1391 |
+
'id' => $prefix . 'portfolio_carousel_title',
|
1392 |
+
'type' => 'text_medium',
|
1393 |
+
));
|
1394 |
+
$kt_portfolio_carousel->add_field( array(
|
1395 |
+
'name' => __('Bottom Portfolio Carousel', 'virtue-toolkit'),
|
1396 |
+
'desc' => __('Display a carousel with portfolio items below project?', 'virtue-toolkit'),
|
1397 |
+
'id' => $prefix . 'portfolio_carousel',
|
1398 |
+
'type' => 'select',
|
1399 |
+
'options' => array(
|
1400 |
+
'default' => __("Default", 'virtue-toolkit' ),
|
1401 |
+
'related' => __("Related Post Carousel", 'virtue-toolkit' ),
|
1402 |
+
'recent' => __("Recent Portfolio Carousel", 'virtue-toolkit' ),
|
1403 |
+
'none' => __("No Carousel", 'virtue-toolkit' ),
|
1404 |
+
),
|
1405 |
+
));
|
1406 |
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: britner
|
|
3 |
Tags:
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 4.7
|
6 |
-
Stable tag:
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -43,6 +43,9 @@ Install the plugin into the `/wp-content/plugins/` folder, and activate it.
|
|
43 |
|
44 |
== Changelog ==
|
45 |
|
|
|
|
|
|
|
46 |
= 3.8 =
|
47 |
* Update: Contact page template in 4.7
|
48 |
|
3 |
Tags:
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 4.7
|
6 |
+
Stable tag: 4.0
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
43 |
|
44 |
== Changelog ==
|
45 |
|
46 |
+
= 4.0 =
|
47 |
+
* Update: add support for ascend
|
48 |
+
|
49 |
= 3.8 =
|
50 |
* Update: Contact page template in 4.7
|
51 |
|
shortcodes.php
CHANGED
@@ -2,69 +2,88 @@
|
|
2 |
//Shortcode for accordion
|
3 |
function kad_accordion_shortcode_function($atts, $content ) {
|
4 |
extract(shortcode_atts(array(
|
5 |
-
'id' => rand(1,
|
6 |
), $atts));
|
7 |
-
$
|
8 |
-
$
|
|
|
|
|
9 |
do_shortcode( $content );
|
10 |
-
if( is_array( $
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
return $return;
|
20 |
}
|
21 |
|
22 |
function kad_accordion_pane_function($atts, $content ) {
|
23 |
extract(shortcode_atts(array(
|
24 |
-
|
25 |
-
|
26 |
), $atts));
|
27 |
-
if ($start
|
28 |
-
|
29 |
-
|
30 |
-
$
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
$
|
34 |
}
|
35 |
function kad_tab_shortcode_function($atts, $content ) {
|
36 |
-
|
37 |
-
'id' => rand(1,
|
38 |
-
|
39 |
-
|
40 |
-
$
|
41 |
-
$
|
|
|
|
|
42 |
do_shortcode( $content );
|
43 |
-
if( is_array( $
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
$tabs[] = '<div class="tab-pane clearfix '.$tab['active'].'" id="sctab'.$id.$tab['link'].'">'.$tab['content'].'</div>';
|
51 |
-
}
|
52 |
|
53 |
-
$return = "\n".'<ul class="nav nav-tabs sc_tabs">'.implode( "\n", $tabnav ).'</ul> <div class="tab-content postclass">'.implode( "\n", $tabs ).'</div>'."\n";
|
54 |
-
}
|
55 |
-
return $return;
|
56 |
}
|
57 |
function kad_tab_pane_function($atts, $content ) {
|
58 |
extract(shortcode_atts(array(
|
59 |
-
'title' => 'Tab %d',
|
60 |
-
'start' => ''
|
61 |
-
), $atts));
|
62 |
-
if ($start
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
$x = $
|
65 |
-
$
|
66 |
|
67 |
-
$
|
68 |
}
|
69 |
|
70 |
//Shortcode for columns
|
@@ -114,9 +133,12 @@ function kad_icon_shortcode_function( $atts) {
|
|
114 |
'size' => '',
|
115 |
'color' => '',
|
116 |
'float'=> ''
|
117 |
-
), $atts));
|
118 |
-
if ($float != '')
|
119 |
-
|
|
|
|
|
|
|
120 |
return $output;
|
121 |
}
|
122 |
// Video Shortcode
|
@@ -200,7 +222,7 @@ function kad_button_shortcode_function( $atts) {
|
|
200 |
'target' => '_self',
|
201 |
'tcolor' => '',
|
202 |
), $atts));
|
203 |
-
$output = '<a href="'.$link.'" class="kad-btn kad-btn-primary" id="kadbtn'.$id.'" target="'.$target.'" style="';
|
204 |
if(!empty($bcolor)) {
|
205 |
$output .= 'background-color:'.$bcolor.';';
|
206 |
}
|
@@ -223,15 +245,15 @@ function kad_blockquote_shortcode_function( $atts, $content) {
|
|
223 |
switch ($align)
|
224 |
{
|
225 |
case "center":
|
226 |
-
$output = '<div class="blockquote-full postclass clearfix">' . do_shortcode($content) . '</div>';
|
227 |
break;
|
228 |
|
229 |
case "left":
|
230 |
-
$output = '<div class="blockquote-left postclass clearfix">' . do_shortcode($content) . '</div>';
|
231 |
break;
|
232 |
|
233 |
case "right":
|
234 |
-
$output = '<div class="blockquote-right postclass clearfix">' . do_shortcode($content) . '</div>';
|
235 |
break;
|
236 |
}
|
237 |
return $output;
|
@@ -244,15 +266,15 @@ function kad_pullquote_shortcode_function( $atts, $content) {
|
|
244 |
switch ($align)
|
245 |
{
|
246 |
case "center":
|
247 |
-
$output = '<div class="pullquote-center">' . do_shortcode($content) . '</div>';
|
248 |
break;
|
249 |
|
250 |
case "right":
|
251 |
-
$output = '<div class="pullquote-right">' . do_shortcode($content) . '</div>';
|
252 |
break;
|
253 |
|
254 |
case "left":
|
255 |
-
$output = '<div class="pullquote-left">' . do_shortcode($content) . '</div>';
|
256 |
break;
|
257 |
}
|
258 |
|
2 |
//Shortcode for accordion
|
3 |
function kad_accordion_shortcode_function($atts, $content ) {
|
4 |
extract(shortcode_atts(array(
|
5 |
+
'id' => rand(1, 999)
|
6 |
), $atts));
|
7 |
+
global $kt_pane_count, $kt_panes;
|
8 |
+
$kt_pane_count = 0;
|
9 |
+
$kt_panes = array();
|
10 |
+
$return = '';
|
11 |
do_shortcode( $content );
|
12 |
+
if( is_array( $kt_panes ) && !empty($kt_panes)){
|
13 |
+
$i = 0;
|
14 |
+
foreach( $kt_panes as $tab ){
|
15 |
+
if ($i % 2 == 0) {
|
16 |
+
$eo = "even";
|
17 |
+
} else {
|
18 |
+
$eo = "odd";
|
19 |
+
}
|
20 |
+
$tabs[] = '<div class="panel panel-default panel-'.$eo.'"><div class="panel-heading"><a class="accordion-toggle '.$tab['open'].'" data-toggle="collapse" data-parent="#accordionname'.$id.'" href="#collapse'.$id.$tab['link'].'"><h5><i class="icon-minus kt-icon-minus primary-color"></i><i class="icon-plus kt-icon-plus"></i>'.$tab['title'].'</h5></a></div><div id="collapse'.$id.$tab['link'].'" class="panel-collapse collapse '.$tab['in'].'"><div class="panel-body postclass">'.$tab['content'].'</div></div></div>';
|
21 |
+
$i++;
|
22 |
+
}
|
23 |
+
$return = "\n".'<div class="panel-group kt-accordion" id="accordionname'.$id.'">'.implode( "\n", $tabs ).'</div>'."\n";
|
24 |
+
}
|
25 |
return $return;
|
26 |
}
|
27 |
|
28 |
function kad_accordion_pane_function($atts, $content ) {
|
29 |
extract(shortcode_atts(array(
|
30 |
+
'title' => 'Pane %d',
|
31 |
+
'start' => ''
|
32 |
), $atts));
|
33 |
+
if (!empty($start) || $start == 'closed') {
|
34 |
+
$open = '';
|
35 |
+
} else {
|
36 |
+
$open = 'collapsed';
|
37 |
+
}
|
38 |
+
if (!empty($start) || $start == 'closed') {
|
39 |
+
$in = 'in';
|
40 |
+
} else {
|
41 |
+
$in = '';
|
42 |
+
}
|
43 |
+
global $kt_pane_count, $kt_panes;
|
44 |
+
$x = $kt_pane_count;
|
45 |
+
$kt_panes[$x] = array( 'title' => $title, 'open' => $open, 'in' => $in, 'link' => $kt_pane_count, 'content' => do_shortcode( $content ) );
|
46 |
|
47 |
+
$kt_pane_count++;
|
48 |
}
|
49 |
function kad_tab_shortcode_function($atts, $content ) {
|
50 |
+
extract(shortcode_atts(array(
|
51 |
+
'id' => rand(1, 9999),
|
52 |
+
'style' => '1',
|
53 |
+
), $atts));
|
54 |
+
global $kt_tab_count, $kt_tabs;
|
55 |
+
$kt_tab_count = 0;
|
56 |
+
$kt_tabs = array();
|
57 |
+
$return = '';
|
58 |
do_shortcode( $content );
|
59 |
+
if( is_array( $kt_tabs ) && !empty($kt_tabs)) {
|
60 |
+
foreach( $kt_tabs as $nav ){
|
61 |
+
$tabnav[] = '<li class="'.$nav['active'].'"><a href="#sctab'.$id.$nav['link'].'">'.$nav['title'].'</a></li>';
|
62 |
+
}
|
63 |
+
foreach( $kt_tabs as $tab ){
|
64 |
+
$tabs[] = '<div class="tab-pane clearfix '.$tab['active'].'" id="sctab'.$id.$tab['link'].'">'.$tab['content'].'</div>';
|
65 |
+
}
|
|
|
|
|
66 |
|
67 |
+
$return = "\n".'<ul class="nav nav-tabs sc_tabs kt-tabs kt-sc-tabs kt-tabs-style'.esc_attr($style).'">'.implode( "\n", $tabnav ).'</ul> <div class="tab-content kt-tab-content postclass">'.implode( "\n", $tabs ).'</div>'."\n";
|
68 |
+
}
|
69 |
+
return $return;
|
70 |
}
|
71 |
function kad_tab_pane_function($atts, $content ) {
|
72 |
extract(shortcode_atts(array(
|
73 |
+
'title' => 'Tab %d',
|
74 |
+
'start' => ''
|
75 |
+
), $atts));
|
76 |
+
if (!empty($start)) {
|
77 |
+
$active = 'active';
|
78 |
+
} else {
|
79 |
+
$active = '';
|
80 |
+
}
|
81 |
+
global $kt_tab_count, $kt_tabs;
|
82 |
|
83 |
+
$x = $kt_tab_count;
|
84 |
+
$kt_tabs[$x] = array( 'title' => $title, 'active' => $active, 'link' => $kt_tab_count, 'content' => do_shortcode( $content ) );
|
85 |
|
86 |
+
$kt_tab_count++;
|
87 |
}
|
88 |
|
89 |
//Shortcode for columns
|
133 |
'size' => '',
|
134 |
'color' => '',
|
135 |
'float'=> ''
|
136 |
+
), $atts));
|
137 |
+
if ($float != '') {
|
138 |
+
$output = '<i class="'.$icon.'" style="font-size:'.$size.'; color:'.$color.'; float:'.$float.'; padding:10px;"></i>';
|
139 |
+
} else {
|
140 |
+
$output = '<i class="'.$icon.'" style="font-size:'.$size.'; color:'.$color.';"></i>';
|
141 |
+
}
|
142 |
return $output;
|
143 |
}
|
144 |
// Video Shortcode
|
222 |
'target' => '_self',
|
223 |
'tcolor' => '',
|
224 |
), $atts));
|
225 |
+
$output = '<a href="'.$link.'" class="btn button btn-shortcode kad-btn kad-btn-primary" id="kadbtn'.$id.'" target="'.$target.'" style="';
|
226 |
if(!empty($bcolor)) {
|
227 |
$output .= 'background-color:'.$bcolor.';';
|
228 |
}
|
245 |
switch ($align)
|
246 |
{
|
247 |
case "center":
|
248 |
+
$output = '<div class="blockquote blockquote-full postclass clearfix">' . do_shortcode($content) . '</div>';
|
249 |
break;
|
250 |
|
251 |
case "left":
|
252 |
+
$output = '<div class="blockquote blockquote-left postclass clearfix">' . do_shortcode($content) . '</div>';
|
253 |
break;
|
254 |
|
255 |
case "right":
|
256 |
+
$output = '<div class="blockquote blockquote-right postclass clearfix">' . do_shortcode($content) . '</div>';
|
257 |
break;
|
258 |
}
|
259 |
return $output;
|
266 |
switch ($align)
|
267 |
{
|
268 |
case "center":
|
269 |
+
$output = '<div class="pullquote pullquote-center">' . do_shortcode($content) . '</div>';
|
270 |
break;
|
271 |
|
272 |
case "right":
|
273 |
+
$output = '<div class="pullquote pullquote-right">' . do_shortcode($content) . '</div>';
|
274 |
break;
|
275 |
|
276 |
case "left":
|
277 |
+
$output = '<div class="pullquote pullquote-left">' . do_shortcode($content) . '</div>';
|
278 |
break;
|
279 |
}
|
280 |
|
shortcodes/icons/icon_popup.php
CHANGED
@@ -65,7 +65,7 @@ var ButtonDialog = {
|
|
65 |
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
66 |
|
67 |
</script>
|
68 |
-
<?php $icons = array( 'icon-glass', 'icon-music', 'icon-search', 'icon-envelope-alt', 'icon-heart', 'icon-star', 'icon-star-empty', 'icon-user', 'icon-film', 'icon-th-large', 'icon-th', 'icon-th-list', 'icon-ok', 'icon-remove', 'icon-zoom-in', 'icon-zoom-out', 'icon-power-off', 'icon-off', 'icon-signal', 'icon-gear', 'icon-cog', 'icon-trash', 'icon-home', 'icon-file-alt', 'icon-time', 'icon-road', 'icon-download-alt', 'icon-download', 'icon-upload', 'icon-inbox', 'icon-play-circle', 'icon-rotate-right', 'icon-repeat', 'icon-refresh', 'icon-list-alt', 'icon-lock', 'icon-flag', 'icon-headphones', 'icon-volume-off', 'icon-volume-down', 'icon-volume-up', 'icon-qrcode', 'icon-barcode', 'icon-tag', 'icon-tags', 'icon-book', 'icon-bookmark', 'icon-print', 'icon-camera', 'icon-font', 'icon-bold', 'icon-italic', 'icon-text-height', 'icon-text-width', 'icon-align-left', 'icon-align-center', 'icon-align-right', 'icon-align-justify', 'icon-list', 'icon-indent-left', 'icon-indent-right', 'icon-facetime-video', 'icon-picture', 'icon-pencil', 'icon-map-marker', 'icon-adjust', 'icon-tint', 'icon-edit', 'icon-share', 'icon-check', 'icon-move', 'icon-step-backward', 'icon-fast-backward', 'icon-backward', 'icon-play', 'icon-pause', 'icon-stop', 'icon-forward', 'icon-fast-forward', 'icon-step-forward', 'icon-eject', 'icon-chevron-left', 'icon-chevron-right', 'icon-plus-sign', 'icon-minus-sign', 'icon-remove-sign', 'icon-ok-sign', 'icon-question-sign', 'icon-info-sign', 'icon-screenshot', 'icon-remove-circle', 'icon-ok-circle', 'icon-ban-circle', 'icon-arrow-left', 'icon-arrow-right', 'icon-arrow-up', 'icon-arrow-down', 'icon-mail-forward', 'icon-share-alt', 'icon-resize-full', 'icon-resize-small', 'icon-plus', 'icon-minus', 'icon-asterisk', 'icon-exclamation-sign', 'icon-gift', 'icon-leaf', 'icon-fire', 'icon-eye-open', 'icon-eye-close', 'icon-warning-sign', 'icon-plane', 'icon-calendar', 'icon-random', 'icon-comment', 'icon-magnet', 'icon-chevron-up', 'icon-chevron-down', 'icon-retweet', 'icon-shopping-cart', 'icon-folder-close', 'icon-folder-open', 'icon-resize-vertical', 'icon-resize-horizontal', 'icon-bar-chart', 'icon-twitter-sign', 'icon-facebook-sign', 'icon-camera-retro', 'icon-key', 'icon-gears', 'icon-cogs', 'icon-comments', 'icon-thumbs-up-alt', 'icon-thumbs-down-alt', 'icon-star-half', 'icon-heart-empty', 'icon-signout', 'icon-linkedin-sign', 'icon-pushpin', 'icon-external-link', 'icon-signin', 'icon-trophy', 'icon-github-sign', 'icon-upload-alt', 'icon-lemon', 'icon-phone', 'icon-unchecked', 'icon-check-empty', 'icon-bookmark-empty', 'icon-phone-sign', 'icon-twitter', 'icon-facebook', 'icon-github', 'icon-unlock', 'icon-credit-card', 'icon-rss', 'icon-hdd', 'icon-bullhorn', 'icon-bell', 'icon-certificate', 'icon-hand-right', 'icon-hand-left', 'icon-hand-up', 'icon-hand-down', 'icon-circle-arrow-left', 'icon-circle-arrow-right', 'icon-circle-arrow-up', 'icon-circle-arrow-down', 'icon-globe', 'icon-wrench', 'icon-tasks', 'icon-filter', 'icon-briefcase', 'icon-fullscreen', 'icon-group', 'icon-link', 'icon-cloud', 'icon-beaker', 'icon-cut', 'icon-copy', 'icon-paperclip', 'icon-paper-clip', 'icon-save', 'icon-sign-blank', 'icon-reorder', 'icon-list-ul', 'icon-list-ol', 'icon-strikethrough', 'icon-underline', 'icon-table', 'icon-magic', 'icon-truck', 'icon-pinterest', 'icon-pinterest-sign', 'icon-google-plus-sign', 'icon-google-plus', 'icon-money', 'icon-caret-down', 'icon-caret-up', 'icon-caret-left', 'icon-caret-right', 'icon-columns', 'icon-sort', 'icon-sort-down', 'icon-sort-up', 'icon-envelope', 'icon-linkedin', 'icon-rotate-left', 'icon-undo', 'icon-legal', 'icon-dashboard', 'icon-comment-alt', 'icon-comments-alt', 'icon-bolt', 'icon-sitemap', 'icon-umbrella', 'icon-paste', 'icon-lightbulb', 'icon-exchange', 'icon-cloud-download', 'icon-cloud-upload', 'icon-user-md', 'icon-stethoscope', 'icon-suitcase', 'icon-bell-alt', 'icon-coffee', 'icon-food', 'icon-file-text-alt', 'icon-building', 'icon-hospital', 'icon-ambulance', 'icon-medkit', 'icon-fighter-jet', 'icon-beer', 'icon-h-sign', 'icon-plus-sign-alt', 'icon-double-angle-left', 'icon-double-angle-right', 'icon-double-angle-up', 'icon-double-angle-down', 'icon-angle-left', 'icon-angle-right', 'icon-angle-up', 'icon-angle-down', 'icon-desktop', 'icon-laptop', 'icon-tablet', 'icon-mobile-phone', 'icon-circle-blank', 'icon-quote-left', 'icon-quote-right', 'icon-spinner', 'icon-circle', 'icon-mail-reply', 'icon-reply', 'icon-github-alt', 'icon-folder-close-alt', 'icon-folder-open-alt', 'icon-expand-alt', 'icon-collapse-alt', 'icon-smile', 'icon-frown', 'icon-meh', 'icon-gamepad', 'icon-keyboard', 'icon-flag-alt', 'icon-flag-checkered', 'icon-terminal', 'icon-code', 'icon-reply-all', 'icon-mail-reply-all', 'icon-star-half-full', 'icon-star-half-empty', 'icon-location-arrow', 'icon-crop', 'icon-code-fork', 'icon-unlink', 'icon-question', 'icon-info', 'icon-exclamation', 'icon-superscript', 'icon-subscript', 'icon-eraser', 'icon-puzzle-piece', 'icon-microphone', 'icon-microphone-off', 'icon-shield', 'icon-calendar-empty', 'icon-fire-extinguisher', 'icon-rocket', 'icon-maxcdn', 'icon-chevron-sign-left', 'icon-chevron-sign-right', 'icon-chevron-sign-up', 'icon-chevron-sign-down', 'icon-html5', 'icon-css3', 'icon-anchor', 'icon-unlock-alt', 'icon-bullseye', 'icon-ellipsis-horizontal', 'icon-ellipsis-vertical', 'icon-rss-sign', 'icon-play-sign', 'icon-ticket', 'icon-minus-sign-alt', 'icon-check-minus', 'icon-level-up', 'icon-level-down', 'icon-check-sign', 'icon-edit-sign', 'icon-external-link-sign', 'icon-share-sign', 'icon-compass', 'icon-collapse', 'icon-collapse-top', 'icon-expand', 'icon-euro', 'icon-eur', 'icon-gbp', 'icon-dollar', 'icon-usd', 'icon-rupee', 'icon-inr', 'icon-yen', 'icon-jpy', 'icon-renminbi', 'icon-cny', 'icon-won', 'icon-krw', 'icon-bitcoin', 'icon-btc', 'icon-file', 'icon-file-text', 'icon-sort-by-alphabet', 'icon-sort-by-alphabet-alt', 'icon-sort-by-attributes', 'icon-sort-by-attributes-alt', 'icon-sort-by-order', 'icon-sort-by-order-alt', 'icon-thumbs-up', 'icon-thumbs-down', 'icon-youtube-sign', 'icon-youtube', 'icon-xing', 'icon-xing-sign', 'icon-youtube-play', 'icon-dropbox', 'icon-stackexchange', 'icon-instagram', 'icon-flickr', 'icon-adn', 'icon-bitbucket', 'icon-bitbucket-sign', 'icon-tumblr', 'icon-tumblr-sign', 'icon-long-arrow-down', 'icon-long-arrow-up', 'icon-long-arrow-left', 'icon-long-arrow-right', 'icon-apple', 'icon-windows', 'icon-android', 'icon-linux', 'icon-dribbble', 'icon-skype', 'icon-foursquare', 'icon-trello', 'icon-female', 'icon-male', 'icon-gittip', 'icon-sun', 'icon-moon', 'icon-archive', 'icon-bug', 'icon-vk', 'icon-weibo', 'icon-renren');
|
69 |
|
70 |
?>
|
71 |
<style type="text/css" media="screen"> .kad-popup {padding: 0 8px; font-size: 0;} #icon-dialog {font-size: 12px;} #icon-dialog label {font-size:14px; display:block; padding:4px;} #icon-dialog label.hex {font-size:12px; line-height:24px; display:inline-block; padding:6px 4px 6px 12px;} .linebreak {margin-bottom:6px; border-bottom: solid 1px #d7d7d7; padding-bottom:6px} #icon-dialog input#icon-color-hex {display:inline-block; height:24px;} #icon-dialog a#insert {margin-top:15px;}
|
65 |
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
66 |
|
67 |
</script>
|
68 |
+
<?php $icons = apply_filters('kt_toolkit_icon_list', array( 'icon-glass', 'icon-music', 'icon-search', 'icon-envelope-alt', 'icon-heart', 'icon-star', 'icon-star-empty', 'icon-user', 'icon-film', 'icon-th-large', 'icon-th', 'icon-th-list', 'icon-ok', 'icon-remove', 'icon-zoom-in', 'icon-zoom-out', 'icon-power-off', 'icon-off', 'icon-signal', 'icon-gear', 'icon-cog', 'icon-trash', 'icon-home', 'icon-file-alt', 'icon-time', 'icon-road', 'icon-download-alt', 'icon-download', 'icon-upload', 'icon-inbox', 'icon-play-circle', 'icon-rotate-right', 'icon-repeat', 'icon-refresh', 'icon-list-alt', 'icon-lock', 'icon-flag', 'icon-headphones', 'icon-volume-off', 'icon-volume-down', 'icon-volume-up', 'icon-qrcode', 'icon-barcode', 'icon-tag', 'icon-tags', 'icon-book', 'icon-bookmark', 'icon-print', 'icon-camera', 'icon-font', 'icon-bold', 'icon-italic', 'icon-text-height', 'icon-text-width', 'icon-align-left', 'icon-align-center', 'icon-align-right', 'icon-align-justify', 'icon-list', 'icon-indent-left', 'icon-indent-right', 'icon-facetime-video', 'icon-picture', 'icon-pencil', 'icon-map-marker', 'icon-adjust', 'icon-tint', 'icon-edit', 'icon-share', 'icon-check', 'icon-move', 'icon-step-backward', 'icon-fast-backward', 'icon-backward', 'icon-play', 'icon-pause', 'icon-stop', 'icon-forward', 'icon-fast-forward', 'icon-step-forward', 'icon-eject', 'icon-chevron-left', 'icon-chevron-right', 'icon-plus-sign', 'icon-minus-sign', 'icon-remove-sign', 'icon-ok-sign', 'icon-question-sign', 'icon-info-sign', 'icon-screenshot', 'icon-remove-circle', 'icon-ok-circle', 'icon-ban-circle', 'icon-arrow-left', 'icon-arrow-right', 'icon-arrow-up', 'icon-arrow-down', 'icon-mail-forward', 'icon-share-alt', 'icon-resize-full', 'icon-resize-small', 'icon-plus', 'icon-minus', 'icon-asterisk', 'icon-exclamation-sign', 'icon-gift', 'icon-leaf', 'icon-fire', 'icon-eye-open', 'icon-eye-close', 'icon-warning-sign', 'icon-plane', 'icon-calendar', 'icon-random', 'icon-comment', 'icon-magnet', 'icon-chevron-up', 'icon-chevron-down', 'icon-retweet', 'icon-shopping-cart', 'icon-folder-close', 'icon-folder-open', 'icon-resize-vertical', 'icon-resize-horizontal', 'icon-bar-chart', 'icon-twitter-sign', 'icon-facebook-sign', 'icon-camera-retro', 'icon-key', 'icon-gears', 'icon-cogs', 'icon-comments', 'icon-thumbs-up-alt', 'icon-thumbs-down-alt', 'icon-star-half', 'icon-heart-empty', 'icon-signout', 'icon-linkedin-sign', 'icon-pushpin', 'icon-external-link', 'icon-signin', 'icon-trophy', 'icon-github-sign', 'icon-upload-alt', 'icon-lemon', 'icon-phone', 'icon-unchecked', 'icon-check-empty', 'icon-bookmark-empty', 'icon-phone-sign', 'icon-twitter', 'icon-facebook', 'icon-github', 'icon-unlock', 'icon-credit-card', 'icon-rss', 'icon-hdd', 'icon-bullhorn', 'icon-bell', 'icon-certificate', 'icon-hand-right', 'icon-hand-left', 'icon-hand-up', 'icon-hand-down', 'icon-circle-arrow-left', 'icon-circle-arrow-right', 'icon-circle-arrow-up', 'icon-circle-arrow-down', 'icon-globe', 'icon-wrench', 'icon-tasks', 'icon-filter', 'icon-briefcase', 'icon-fullscreen', 'icon-group', 'icon-link', 'icon-cloud', 'icon-beaker', 'icon-cut', 'icon-copy', 'icon-paperclip', 'icon-paper-clip', 'icon-save', 'icon-sign-blank', 'icon-reorder', 'icon-list-ul', 'icon-list-ol', 'icon-strikethrough', 'icon-underline', 'icon-table', 'icon-magic', 'icon-truck', 'icon-pinterest', 'icon-pinterest-sign', 'icon-google-plus-sign', 'icon-google-plus', 'icon-money', 'icon-caret-down', 'icon-caret-up', 'icon-caret-left', 'icon-caret-right', 'icon-columns', 'icon-sort', 'icon-sort-down', 'icon-sort-up', 'icon-envelope', 'icon-linkedin', 'icon-rotate-left', 'icon-undo', 'icon-legal', 'icon-dashboard', 'icon-comment-alt', 'icon-comments-alt', 'icon-bolt', 'icon-sitemap', 'icon-umbrella', 'icon-paste', 'icon-lightbulb', 'icon-exchange', 'icon-cloud-download', 'icon-cloud-upload', 'icon-user-md', 'icon-stethoscope', 'icon-suitcase', 'icon-bell-alt', 'icon-coffee', 'icon-food', 'icon-file-text-alt', 'icon-building', 'icon-hospital', 'icon-ambulance', 'icon-medkit', 'icon-fighter-jet', 'icon-beer', 'icon-h-sign', 'icon-plus-sign-alt', 'icon-double-angle-left', 'icon-double-angle-right', 'icon-double-angle-up', 'icon-double-angle-down', 'icon-angle-left', 'icon-angle-right', 'icon-angle-up', 'icon-angle-down', 'icon-desktop', 'icon-laptop', 'icon-tablet', 'icon-mobile-phone', 'icon-circle-blank', 'icon-quote-left', 'icon-quote-right', 'icon-spinner', 'icon-circle', 'icon-mail-reply', 'icon-reply', 'icon-github-alt', 'icon-folder-close-alt', 'icon-folder-open-alt', 'icon-expand-alt', 'icon-collapse-alt', 'icon-smile', 'icon-frown', 'icon-meh', 'icon-gamepad', 'icon-keyboard', 'icon-flag-alt', 'icon-flag-checkered', 'icon-terminal', 'icon-code', 'icon-reply-all', 'icon-mail-reply-all', 'icon-star-half-full', 'icon-star-half-empty', 'icon-location-arrow', 'icon-crop', 'icon-code-fork', 'icon-unlink', 'icon-question', 'icon-info', 'icon-exclamation', 'icon-superscript', 'icon-subscript', 'icon-eraser', 'icon-puzzle-piece', 'icon-microphone', 'icon-microphone-off', 'icon-shield', 'icon-calendar-empty', 'icon-fire-extinguisher', 'icon-rocket', 'icon-maxcdn', 'icon-chevron-sign-left', 'icon-chevron-sign-right', 'icon-chevron-sign-up', 'icon-chevron-sign-down', 'icon-html5', 'icon-css3', 'icon-anchor', 'icon-unlock-alt', 'icon-bullseye', 'icon-ellipsis-horizontal', 'icon-ellipsis-vertical', 'icon-rss-sign', 'icon-play-sign', 'icon-ticket', 'icon-minus-sign-alt', 'icon-check-minus', 'icon-level-up', 'icon-level-down', 'icon-check-sign', 'icon-edit-sign', 'icon-external-link-sign', 'icon-share-sign', 'icon-compass', 'icon-collapse', 'icon-collapse-top', 'icon-expand', 'icon-euro', 'icon-eur', 'icon-gbp', 'icon-dollar', 'icon-usd', 'icon-rupee', 'icon-inr', 'icon-yen', 'icon-jpy', 'icon-renminbi', 'icon-cny', 'icon-won', 'icon-krw', 'icon-bitcoin', 'icon-btc', 'icon-file', 'icon-file-text', 'icon-sort-by-alphabet', 'icon-sort-by-alphabet-alt', 'icon-sort-by-attributes', 'icon-sort-by-attributes-alt', 'icon-sort-by-order', 'icon-sort-by-order-alt', 'icon-thumbs-up', 'icon-thumbs-down', 'icon-youtube-sign', 'icon-youtube', 'icon-xing', 'icon-xing-sign', 'icon-youtube-play', 'icon-dropbox', 'icon-stackexchange', 'icon-instagram', 'icon-flickr', 'icon-adn', 'icon-bitbucket', 'icon-bitbucket-sign', 'icon-tumblr', 'icon-tumblr-sign', 'icon-long-arrow-down', 'icon-long-arrow-up', 'icon-long-arrow-left', 'icon-long-arrow-right', 'icon-apple', 'icon-windows', 'icon-android', 'icon-linux', 'icon-dribbble', 'icon-skype', 'icon-foursquare', 'icon-trello', 'icon-female', 'icon-male', 'icon-gittip', 'icon-sun', 'icon-moon', 'icon-archive', 'icon-bug', 'icon-vk', 'icon-weibo', 'icon-renren'));
|
69 |
|
70 |
?>
|
71 |
<style type="text/css" media="screen"> .kad-popup {padding: 0 8px; font-size: 0;} #icon-dialog {font-size: 12px;} #icon-dialog label {font-size:14px; display:block; padding:4px;} #icon-dialog label.hex {font-size:12px; line-height:24px; display:inline-block; padding:6px 4px 6px 12px;} .linebreak {margin-bottom:6px; border-bottom: solid 1px #d7d7d7; padding-bottom:6px} #icon-dialog input#icon-color-hex {display:inline-block; height:24px;} #icon-dialog a#insert {margin-top:15px;}
|
virtue_toolkit.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
Plugin Name: Kadence Toolkit
|
5 |
Description: Custom Portfolio and Shortcode functionality for free Kadence WordPress themes
|
6 |
-
Version:
|
7 |
Author: Kadence Themes
|
8 |
Author URI: https://kadencethemes.com/
|
9 |
License: GPLv2 or later
|
@@ -22,6 +22,7 @@ register_deactivation_hook(__FILE__, 'virtue_toolkit_deactivation');
|
|
22 |
add_filter( 'kadence_theme_options_args', 'kadencetoolkit_redux_args_new');
|
23 |
function kadencetoolkit_redux_args_new( $args ) {
|
24 |
$args['customizer_only'] = false;
|
|
|
25 |
return $args;
|
26 |
}
|
27 |
require_once('post-types.php');
|
3 |
/*
|
4 |
Plugin Name: Kadence Toolkit
|
5 |
Description: Custom Portfolio and Shortcode functionality for free Kadence WordPress themes
|
6 |
+
Version: 4.0
|
7 |
Author: Kadence Themes
|
8 |
Author URI: https://kadencethemes.com/
|
9 |
License: GPLv2 or later
|
22 |
add_filter( 'kadence_theme_options_args', 'kadencetoolkit_redux_args_new');
|
23 |
function kadencetoolkit_redux_args_new( $args ) {
|
24 |
$args['customizer_only'] = false;
|
25 |
+
$args['save_defaults'] = true;
|
26 |
return $args;
|
27 |
}
|
28 |
require_once('post-types.php');
|