| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly. |
| 4 |
} |
| 5 |
/***************************************************************************************************************************************************** |
| 6 |
****************************************************************************************************************************************************** |
| 7 |
|
| 8 |
Slider Text Options |
| 9 |
|
| 10 |
*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 11 |
if (is_admin()){ |
| 12 |
if ( !function_exists ( "vs_button_options" )){ |
| 13 |
add_filter('vs_layer_element_options', 'vs_button_options'); |
| 14 |
function vs_button_options( $element ) { |
| 15 |
$option = array(); |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
$item = array( |
| 22 |
'name' => __('Button','visual-slider'), |
| 23 |
'id' => 'button', |
| 24 |
'img' => VISUALSLIDER_DIR .'admin/assets/image/layer_button.png' |
| 25 |
|
| 26 |
); |
| 27 |
|
| 28 |
include VISUALSLIDER_PATH . 'layer/mini/position_size.php'; |
| 29 |
|
| 30 |
|
| 31 |
$option[]= array( |
| 32 |
"name" => __('Button Text','visual-slider'), |
| 33 |
"default" => __('Button','visual-slider'), |
| 34 |
"id" => "button", |
| 35 |
"type" => "textarea", |
| 36 |
"group" => __('Content','visual-slider'), |
| 37 |
); |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
$option[]= array( |
| 43 |
"name" => __('Link','visual-slider'), |
| 44 |
"id" => "button_link", |
| 45 |
"type" => "text", |
| 46 |
"width" => "100%", |
| 47 |
"warp_width" => "100%", |
| 48 |
"placeholder" => "http://", |
| 49 |
"group" => __('Content','visual-slider'), |
| 50 |
); |
| 51 |
|
| 52 |
$option[] = array( |
| 53 |
"name" => __('Open in a new window','visual-slider'), |
| 54 |
"id" => "button_widows", |
| 55 |
"type" => "checkbox", |
| 56 |
"group" => __('Content','visual-slider'), |
| 57 |
); |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
$option[]= array( |
| 63 |
"name" => __('Alignment','visual-slider'), |
| 64 |
"id" => "button_align", |
| 65 |
"type" => "radio_image", |
| 66 |
"responsive" => "desktop", |
| 67 |
|
| 68 |
"default" => 'center', |
| 69 |
"group" => __('Content','visual-slider'), |
| 70 |
"options" => array( |
| 71 |
'left' => VISUALSLIDER_DIR.'admin/assets/image/left.jpg', |
| 72 |
'center' => VISUALSLIDER_DIR.'admin/assets/image/center.jpg', |
| 73 |
'right' => VISUALSLIDER_DIR.'admin/assets/image/right.jpg', |
| 74 |
), |
| 75 |
|
| 76 |
); |
| 77 |
|
| 78 |
if(!empty(wp_unslash(filter_input( INPUT_POST, 'vs_tablet', FILTER_VALIDATE_BOOLEAN )))){ |
| 79 |
|
| 80 |
$option[]= array( |
| 81 |
"responsive" => "tablet", |
| 82 |
"name" => __('Responsive on Tablet','visual-slider'), |
| 83 |
"group" => __('Content','visual-slider'), |
| 84 |
"id" => "tablet_button_align_heading", |
| 85 |
"type" => "heading", |
| 86 |
); |
| 87 |
|
| 88 |
$option[]= array( |
| 89 |
"responsive" => "tablet", |
| 90 |
|
| 91 |
"name" => __('Alignment on Tablet','visual-slider'), |
| 92 |
"id" => "tablet_button_align", |
| 93 |
"type" => "radio_image", |
| 94 |
"default" => '', |
| 95 |
"group" => __('Content','visual-slider'), |
| 96 |
"options" => array( |
| 97 |
'' => VISUALSLIDER_DIR.'admin/assets/image/none.jpg', |
| 98 |
'left' => VISUALSLIDER_DIR.'admin/assets/image/left.jpg', |
| 99 |
'center' => VISUALSLIDER_DIR.'admin/assets/image/center.jpg', |
| 100 |
'right' => VISUALSLIDER_DIR.'admin/assets/image/righy.jpg', |
| 101 |
), |
| 102 |
|
| 103 |
); |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
} |
| 108 |
if(!empty(wp_unslash(filter_input( INPUT_POST, 'vs_mobile', FILTER_VALIDATE_BOOLEAN )))){ |
| 109 |
|
| 110 |
|
| 111 |
$option[]= array( |
| 112 |
"responsive" => "mobile", |
| 113 |
"name" => __('Responsive on Mobile','visual-slider'), |
| 114 |
"group" => __('Content','visual-slider'), |
| 115 |
"id" => "tablet_button_align_heading", |
| 116 |
"type" => "heading", |
| 117 |
); |
| 118 |
|
| 119 |
$option[]= array( |
| 120 |
"responsive" => "mobile", |
| 121 |
|
| 122 |
"name" => __('Alignment on Tablet','visual-slider'), |
| 123 |
"id" => "mobile_button_align", |
| 124 |
"type" => "radio_image", |
| 125 |
"default" => '', |
| 126 |
"group" => __('Content','visual-slider'), |
| 127 |
"options" => array( |
| 128 |
'' => VISUALSLIDER_DIR.'admin/assets/image/none.jpg', |
| 129 |
'left' => VISUALSLIDER_DIR.'admin/assets/image/left.jpg', |
| 130 |
'center' => VISUALSLIDER_DIR.'admin/assets/image/center.jpg', |
| 131 |
'right' => VISUALSLIDER_DIR.'admin/assets/image/right.jpg', |
| 132 |
), |
| 133 |
|
| 134 |
); |
| 135 |
|
| 136 |
|
| 137 |
} |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
/// *********************** Text*************************************************************************************/ |
| 142 |
$option[]= array( |
| 143 |
"name" => __('Icon','visual-slider'), |
| 144 |
"id" => "icon", |
| 145 |
"type" => "icon", |
| 146 |
"group" => __('Icon','visual-slider'), |
| 147 |
); |
| 148 |
$option[]= array( |
| 149 |
"name" => __('Icon Align','visual-slider'), |
| 150 |
"id" => "icon_align", |
| 151 |
"fold" => array( |
| 152 |
true => 'icon', |
| 153 |
), |
| 154 |
"type" => "radio_image", |
| 155 |
"group" => __('Icon','visual-slider'), |
| 156 |
"options" => array( |
| 157 |
'left' => VISUALSLIDER_DIR.'admin/assets/image/left.jpg', |
| 158 |
'right' => VISUALSLIDER_DIR.'admin/assets/image/right.jpg', |
| 159 |
), |
| 160 |
|
| 161 |
); |
| 162 |
|
| 163 |
$option[]= array( |
| 164 |
"name" => __('Hover','visual-slider'), |
| 165 |
"id" => "icon_effects", |
| 166 |
"group" => __('Icon','visual-slider'), |
| 167 |
"type" => "hover", |
| 168 |
"fold" => array( |
| 169 |
true => 'icon', |
| 170 |
) , |
| 171 |
"options" => array( |
| 172 |
'normal' => __('NORMAL','visual-slider'), |
| 173 |
'hover' => __('HOVER','visual-slider'), |
| 174 |
), |
| 175 |
); |
| 176 |
|
| 177 |
$option[]= array( |
| 178 |
"name" => __('Icon Color','visual-slider'), |
| 179 |
"id" => "icon_color", |
| 180 |
"fold" => array( |
| 181 |
'normal' => 'icon_effects', |
| 182 |
), |
| 183 |
|
| 184 |
"group" => __('Icon','visual-slider'), |
| 185 |
"type" => "multi_options", |
| 186 |
"options" => array( |
| 187 |
array( |
| 188 |
"id" => "first", |
| 189 |
"type" => "color_rgba", |
| 190 |
), |
| 191 |
), |
| 192 |
); |
| 193 |
$option[]= array( |
| 194 |
"name" => __('Icon Hover Color','visual-slider'), |
| 195 |
"id" => "icon_hover_color", |
| 196 |
"fold" => array( |
| 197 |
'hover' => 'icon_effects', |
| 198 |
|
| 199 |
), |
| 200 |
"group" => __('Icon','visual-slider'), |
| 201 |
"type" => "multi_options", |
| 202 |
"options" => array( |
| 203 |
array( |
| 204 |
"id" => "first", |
| 205 |
"type" => "color_rgba", |
| 206 |
), |
| 207 |
), |
| 208 |
); |
| 209 |
|
| 210 |
|
| 211 |
$option[]= array( |
| 212 |
"name" => __('Hover','visual-slider'), |
| 213 |
"id" => "button_effects", |
| 214 |
"group" => __('Style','visual-slider'), |
| 215 |
"type" => "hover", |
| 216 |
"options" => array( |
| 217 |
'normal' => __('NORMAL','visual-slider'), |
| 218 |
'hover' => __('HOVER','visual-slider'), |
| 219 |
), |
| 220 |
); |
| 221 |
|
| 222 |
/// *********************** Text*************************************************************************************/ |
| 223 |
$option[]= array( |
| 224 |
"name" => __('Button Color','visual-slider'), |
| 225 |
"id" => "button_color", |
| 226 |
"fold" => array( |
| 227 |
'normal' => 'button_effects', |
| 228 |
) , |
| 229 |
"group" => __('Style','visual-slider'), |
| 230 |
"type" => "multi_options", |
| 231 |
"options" => array( |
| 232 |
array( |
| 233 |
"id" => "first", |
| 234 |
"type" => "color_rgba", |
| 235 |
), |
| 236 |
), |
| 237 |
); |
| 238 |
|
| 239 |
$option[]= array( |
| 240 |
"name" => __('Button Hover Color','visual-slider'), |
| 241 |
"id" => "button_hover_color", |
| 242 |
"fold" => array( |
| 243 |
'hover' => 'button_effects', |
| 244 |
) , |
| 245 |
"group" => __('Style','visual-slider'), |
| 246 |
"type" => "multi_options", |
| 247 |
"options" => array( |
| 248 |
array( |
| 249 |
"id" => "first", |
| 250 |
"type" => "color_rgba", |
| 251 |
), |
| 252 |
), |
| 253 |
); |
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
$option[]= array( |
| 259 |
"name" => __('Text Shadow','visual-slider'), |
| 260 |
"id" => "button_shadow", |
| 261 |
"fold" => array( |
| 262 |
'normal' => 'button_effects', |
| 263 |
) , |
| 264 |
"group" => __('Style','visual-slider'), |
| 265 |
"type" => "multi_options", |
| 266 |
"options" => vs_multi_array_options('text_shadow'), |
| 267 |
|
| 268 |
); |
| 269 |
|
| 270 |
|
| 271 |
$option[]= array( |
| 272 |
"name" => __('Hover Text Shadow','visual-slider'), |
| 273 |
"id" => "button_hover_shadow", |
| 274 |
"fold" => array( |
| 275 |
'hover' => 'button_effects', |
| 276 |
) , |
| 277 |
"group" => __('Style','visual-slider'), |
| 278 |
"type" => "multi_options", |
| 279 |
|
| 280 |
"options" => vs_multi_array_options('text_shadow'), |
| 281 |
|
| 282 |
); |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
/***********************************boxed************************************************************************************/ |
| 287 |
$boxed='button'; |
| 288 |
include VISUALSLIDER_PATH . 'layer/mini/button_boxed.php'; |
| 289 |
|
| 290 |
include VISUALSLIDER_PATH . 'layer/mini/button_typography.php'; |
| 291 |
|
| 292 |
include VISUALSLIDER_PATH . 'layer/mini/effect.php'; |
| 293 |
|
| 294 |
$item['options']=$option; |
| 295 |
$element[]=$item; |
| 296 |
return $element; |
| 297 |
} |
| 298 |
} |
| 299 |
} |
| 300 |
/***************************************************************************************************************************************************** |
| 301 |
****************************************************************************************************************************************************** |
| 302 |
|
| 303 |
Slider Text Config |
| 304 |
|
| 305 |
*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 306 |
if ( !function_exists ( "vs_button_perview" )){ |
| 307 |
add_filter('vs_layer_perview_button', 'vs_button_perview'); |
| 308 |
function vs_button_perview( $value ) { |
| 309 |
$option= $value['option']; |
| 310 |
$key= $value['key']; |
| 311 |
echo '<aside id="vs_perview_layer_'.esc_attr($key).'" class="vs_draggable vs-layer-item " data-key="'.esc_attr($key).'" >'; |
| 312 |
echo '<div class="vs-button vs-layer-content " >'; |
| 313 |
echo '</div>'; |
| 314 |
echo '<div class="vs-layer-style"> </div>'; |
| 315 |
echo '</aside>'; |
| 316 |
} |
| 317 |
} |
| 318 |
|
| 319 |
if ( !function_exists ( "vs_button_config" )){ |
| 320 |
add_filter('vs_layer_button', 'vs_button_config'); |
| 321 |
function vs_button_config( $value ) { |
| 322 |
$option= $value['option']; |
| 323 |
$key= $value['key']; |
| 324 |
$global_key= $value['global_key']; |
| 325 |
$slide_key= $value['slide_key']; |
| 326 |
|
| 327 |
$button_boxed = !empty($option['button_boxed'])?$option['button_boxed']:'boxed'; |
| 328 |
if($button_boxed=='boxed'){ |
| 329 |
$boxed ='vs-button-boxed'; |
| 330 |
}else{ |
| 331 |
$boxed ='vs-button-none'; |
| 332 |
} |
| 333 |
$icon_align = !empty($option['icon_align'])?'vs-icon-'.vs_rtl_has($option['icon_align']).' ':''; |
| 334 |
|
| 335 |
$button_link = !empty( $option['button_link'])? ' href="'.$option['button_link'].'"':''; |
| 336 |
$target = !empty($option['button_widows']) ? 'target="_blank"' : ''; |
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
//button Css |
| 341 |
echo '<aside class="vs-layer-'.esc_attr($key).' vs-layer-item '.esc_attr(vs_layer_effect_class($option)).'" >'; |
| 342 |
|
| 343 |
|
| 344 |
echo wp_kses('<a class="vs-button '.esc_attr($boxed).' vs-layer-content '.esc_attr($icon_align).'" '.$button_link.''.$target.' >',vs_kses()); |
| 345 |
|
| 346 |
if(!empty($option['icon'])){ |
| 347 |
vs_icon_fontfamily($option['icon']); |
| 348 |
echo '<i class="'.esc_attr($option['icon']).'"></i>'; |
| 349 |
} |
| 350 |
if(!empty($option['button'])){ |
| 351 |
echo wp_kses($option['button'],vs_kses()); |
| 352 |
} |
| 353 |
|
| 354 |
echo '</a>'; |
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
$css=vs_layer_position( $option); |
| 359 |
$css.= vs_slider_var_align( 'txt-ag',$option,'button_align' ); |
| 360 |
$css.= vs_slider_var_align( 'tab-txt-ag',$option,'tablet_button_align' ); |
| 361 |
$css.= vs_slider_var_align( 'mob-txt-ag',$option,'mobile_button_align' ); |
| 362 |
$css.= vs_slider_var_2( 'btn-cr',$option,'button_color','first'); |
| 363 |
$css.= vs_slider_var_2( 'btn-hv-cr',$option,'button_hover_color','first'); |
| 364 |
$css.= vs_slider_var_text_shadow( 'btn',$option,'button_shadow'); |
| 365 |
$css.= vs_slider_var_text_shadow( 'btn-hv',$option,'button_hover_shadow','first'); |
| 366 |
$css.= vs_slider_var_2( 'icn-cr',$option,'icon_color','first'); |
| 367 |
$css.= vs_slider_var_2( 'icn-hv-cr',$option,'icon_hover_color','first'); |
| 368 |
|
| 369 |
|
| 370 |
if($button_boxed=='boxed'){ |
| 371 |
$css.=vs_slider_var_padding( 'btn-box-pd',$option,'button_boxed_padding'); |
| 372 |
$css.= vs_slider_var_gradient_background_color( 'btn-box',$option,'button_boxed_background'); |
| 373 |
$css.= vs_slider_var_gradient_background_color( 'btn-box-hv',$option,'button_boxed_hover_background'); |
| 374 |
$css.= vs_slider_var_border( 'btn-box',$option,'button_boxed_border'); |
| 375 |
$css.= vs_slider_var_border( 'btn-box-hv',$option,'button_boxed_hover_border'); |
| 376 |
$css.= vs_slider_var_shadow( 'btn-box',$option,'button_boxed_shadow'); |
| 377 |
$css.= vs_slider_var_shadow( 'btn-box-hv',$option,'button_boxed_hover_shadow'); |
| 378 |
$css.= vs_slider_var_radius( 'btn-box',$option,'button_boxed_radius'); |
| 379 |
} |
| 380 |
$css.=vs_slider_var( 'btn-fn-fm',$option,'button_fontfamily'); |
| 381 |
|
| 382 |
$css.=vs_slider_var_unit( 'btn-fn-sz',$option,'button_font_size','px'); |
| 383 |
$css.=vs_slider_var( 'btn-fn-wt',$option,'button_font_weight'); |
| 384 |
$css.=vs_slider_var( 'btn-fn-de',$option,'button_font_decoration'); |
| 385 |
$css.=vs_slider_var( 'btn-fn-tf',$option,'button_font_transform'); |
| 386 |
$css.=vs_slider_var_unit( 'btn-lt-sp',$option,'button_spacing','px'); |
| 387 |
$css.=vs_slider_var( 'btn-fn-st',$option,'button_font_style'); |
| 388 |
|
| 389 |
$css.=vs_slider_var_unit( 'tab-btn-fn-sz',$option,'tablet_button_font_size','px'); |
| 390 |
$css.=vs_slider_var_unit( 'mob-btn-fn-sz',$option,'mobile_button_font_size','px'); |
| 391 |
$css.=vs_layer_effect( $option); |
| 392 |
$fontface = vs_slider_fontface($option,'button_fontfamily','button_font_weight'); |
| 393 |
if(!is_rtl()){ |
| 394 |
vs_slider_fonts_family($option,'text_fontfamily','text_font_weight'); |
| 395 |
} |
| 396 |
$item=''; |
| 397 |
if(!empty($global_key)){ |
| 398 |
$item.='.vs-global-'.$global_key.' '; |
| 399 |
} |
| 400 |
if(!empty($slide_key)){ |
| 401 |
$item.='.vs-slide-'.$slide_key.' '; |
| 402 |
} |
| 403 |
if(!empty($key)){ |
| 404 |
$item.='.vs-layer-'.$key.' '; |
| 405 |
} |
| 406 |
echo '<style>'.wp_kses(vs_slider_item_css( $css,$item).$fontface,vs_kses()).'</style>'; |
| 407 |
|
| 408 |
echo '</aside>'; |
| 409 |
} |
| 410 |
} |
| 411 |
|