← All changes
|
includes/widgets/Magazine_Grid/Magazine_Grid.php
+5727
-0
51.1.2
→
51.1.83
View file →
| @@ -1,0 +1,5727 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace King_Addons; | |
| 4 | + | |
| 5 | +use Elementor\Icons_Manager; | |
| 6 | +use Elementor\Widget_Base; | |
| 7 | +use Elementor\Controls_Manager; | |
| 8 | +use Elementor\Group_Control_Box_Shadow; | |
| 9 | +use Elementor\Group_Control_Typography; | |
| 10 | +use Elementor\Group_Control_Background; | |
| 11 | +use Elementor\Repeater; | |
| 12 | +use Elementor\Group_Control_Image_Size; | |
| 13 | +use WP_Query; | |
| 14 | + | |
| 15 | +if (!defined('ABSPATH')) { | |
| 16 | + exit; | |
| 17 | +} | |
| 18 | + | |
| 19 | +class Magazine_Grid extends Widget_Base | |
| 20 | +{ | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + public function get_name() | |
| 25 | + { | |
| 26 | + return 'king-addons-magazine-grid'; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public function get_title() | |
| 30 | + { | |
| 31 | + return esc_html__('Magazine Grid & Slider', 'king-addons'); | |
| 32 | + } | |
| 33 | + | |
| 34 | + public function get_icon() | |
| 35 | + { | |
| 36 | + return 'king-addons-icon king-addons-magazine-grid'; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public function get_categories() | |
| 40 | + { | |
| 41 | + return ['king-addons']; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public function get_keywords() | |
| 45 | + { | |
| 46 | + return ['king addons', 'king', 'addons', 'kingaddons', 'king-addons', 'blog', 'grid', 'posts', 'magazine', 'masonry', | |
| 47 | + 'magazine grid', 'magazine slider', 'isotope', 'slick', 'post tiles', 'posts tiles', 'post', 'journal', 'gr', | |
| 48 | + 'tile', 'tiles', 'carousel', 'loop', 'filterable']; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public function get_script_depends() | |
| 52 | + { | |
| 53 | + return [ | |
| 54 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-magazine-grid-script', | |
| 55 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-isotope-kng', | |
| 56 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-slick', | |
| 57 | + ]; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public function get_style_depends() | |
| 61 | + { | |
| 62 | + return [ | |
| 63 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-helper', | |
| 64 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-button', | |
| 65 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-general', | |
| 66 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-timing', | |
| 67 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-loading', | |
| 68 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-grid-grid', | |
| 69 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-general-general', | |
| 70 | + ]; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public function get_custom_help_url() | |
| 74 | + { | |
| 75 | + return 'mailto:bug@kingaddons.com?subject=Bug Report - King Addons&body=Please describe the issue'; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public function has_widget_inner_wrapper(): bool | |
| 79 | + { | |
| 80 | + return true; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public function add_option_query_source() | |
| 84 | + { | |
| 85 | + $post_types = [ | |
| 86 | + 'post' => esc_html__('Posts', 'king-addons'), | |
| 87 | + 'page' => esc_html__('Pages', 'king-addons'), | |
| 88 | + ]; | |
| 89 | + | |
| 90 | + $excluded_slugs = ['product', 'e-landing-page']; | |
| 91 | + $can_use_premium = king_addons_freemius()->can_use_premium_code__premium_only(); | |
| 92 | + $custom_post_types = Core::getCustomTypes('post'); | |
| 93 | + | |
| 94 | + foreach ($custom_post_types as $slug => $title) { | |
| 95 | + // Skip excluded slugs | |
| 96 | + if (in_array($slug, $excluded_slugs, true)) { | |
| 97 | + continue; | |
| 98 | + } | |
| 99 | + | |
| 100 | + // Add either as-is or with "Pro" label | |
| 101 | + if ($can_use_premium) { | |
| 102 | + $post_types[$slug] = esc_html($title); | |
| 103 | + } else { | |
| 104 | + $post_types['pro-' . substr($slug, 0, 2)] = esc_html($title) . ' (Pro)'; | |
| 105 | + } | |
| 106 | + } | |
| 107 | + | |
| 108 | + // Append special "Pro" keys | |
| 109 | + $post_types['pro-cr'] = esc_html__('Current Query (Pro)', 'king-addons'); | |
| 110 | + $post_types['pro-rl'] = esc_html__('Related Query (Pro)', 'king-addons'); | |
| 111 | + | |
| 112 | + return $post_types; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public function get_available_taxonomies() | |
| 116 | + { | |
| 117 | + $post_taxonomies = [ | |
| 118 | + 'category' => esc_html__('Categories', 'king-addons'), | |
| 119 | + 'post_tag' => esc_html__('Tags', 'king-addons'), | |
| 120 | + ]; | |
| 121 | + | |
| 122 | + $excluded_slugs = ['product_tag', 'product_cat']; | |
| 123 | + $can_use_premium = king_addons_freemius()->can_use_premium_code__premium_only(); | |
| 124 | + $custom_post_taxonomies = Core::getCustomTypes('tax'); | |
| 125 | + | |
| 126 | + foreach ($custom_post_taxonomies as $slug => $title) { | |
| 127 | + // Skip excluded slugs | |
| 128 | + if (in_array($slug, $excluded_slugs, true)) { | |
| 129 | + continue; | |
| 130 | + } | |
| 131 | + | |
| 132 | + // Add either as-is or with "Pro" label | |
| 133 | + if ($can_use_premium) { | |
| 134 | + $post_taxonomies[$slug] = esc_html($title); | |
| 135 | + } else { | |
| 136 | + $post_taxonomies['pro-' . substr($slug, 0, 2)] = esc_html($title) . ' (Pro)'; | |
| 137 | + } | |
| 138 | + } | |
| 139 | + | |
| 140 | + return $post_taxonomies; | |
| 141 | + } | |
| 142 | + | |
| 143 | + | |
| 144 | + public function add_control_open_links_in_new_tab() | |
| 145 | + { | |
| 146 | + $this->add_control( | |
| 147 | + 'open_links_in_new_tab', | |
| 148 | + [ | |
| 149 | + 'label' => sprintf(__('Open Links in New Tab %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 150 | + 'type' => Controls_Manager::SWITCHER, | |
| 151 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 152 | + ] | |
| 153 | + ); | |
| 154 | + } | |
| 155 | + | |
| 156 | + public function add_control_query_randomize() | |
| 157 | + { | |
| 158 | + $this->add_control( | |
| 159 | + 'query_randomize', | |
| 160 | + [ | |
| 161 | + 'label' => sprintf(__('Randomize Query %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 162 | + 'type' => Controls_Manager::SWITCHER, | |
| 163 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 164 | + ] | |
| 165 | + ); | |
| 166 | + } | |
| 167 | + | |
| 168 | + public function add_control_order_posts() | |
| 169 | + { | |
| 170 | + $this->add_control( | |
| 171 | + 'order_posts', | |
| 172 | + [ | |
| 173 | + 'label' => esc_html__('Order By', 'king-addons'), | |
| 174 | + 'type' => Controls_Manager::SELECT, | |
| 175 | + 'default' => 'date', | |
| 176 | + 'label_block' => false, | |
| 177 | + 'options' => [ | |
| 178 | + 'date' => esc_html__('Date', 'king-addons'), | |
| 179 | + 'pro-tl' => esc_html__('Title (Pro)', 'king-addons'), | |
| 180 | + 'pro-mf' => esc_html__('Last Modified (Pro)', 'king-addons'), | |
| 181 | + 'pro-d' => esc_html__('Post ID', 'king-addons'), | |
| 182 | + 'pro-ar' => esc_html__('Post Author', 'king-addons'), | |
| 183 | + 'pro-cc' => esc_html__('Comment Count', 'king-addons') | |
| 184 | + ], | |
| 185 | + 'condition' => [ | |
| 186 | + 'query_randomize!' => 'rand', | |
| 187 | + ] | |
| 188 | + ] | |
| 189 | + ); | |
| 190 | + } | |
| 191 | + | |
| 192 | + public function add_control_force_responsive_one_column() | |
| 193 | + { | |
| 194 | + $this->add_control( | |
| 195 | + 'force_responsive_one_column', | |
| 196 | + [ | |
| 197 | + 'label' => sprintf(__('Force Responsive One Column %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 198 | + 'type' => Controls_Manager::SWITCHER, | |
| 199 | + 'classes' => 'king-addons-pro-control' | |
| 200 | + ] | |
| 201 | + ); | |
| 202 | + } | |
| 203 | + | |
| 204 | + public function add_option_element_select() | |
| 205 | + { | |
| 206 | + return [ | |
| 207 | + 'title' => esc_html__('Title', 'king-addons'), | |
| 208 | + 'content' => esc_html__('Content', 'king-addons'), | |
| 209 | + 'excerpt' => esc_html__('Excerpt', 'king-addons'), | |
| 210 | + 'date' => esc_html__('Date', 'king-addons'), | |
| 211 | + 'time' => esc_html__('Time', 'king-addons'), | |
| 212 | + 'author' => esc_html__('Author', 'king-addons'), | |
| 213 | + 'comments' => esc_html__('Comments', 'king-addons'), | |
| 214 | + 'read-more' => esc_html__('Read More', 'king-addons'), | |
| 215 | + 'separator' => esc_html__('Separator', 'king-addons'), | |
| 216 | + 'pro-lk' => esc_html__('Likes (Pro)', 'king-addons'), | |
| 217 | + 'pro-shr' => esc_html__('Sharing (Pro)', 'king-addons'), | |
| 218 | + 'pro-cf' => esc_html__('Custom Field (Pro)', 'king-addons'), | |
| 219 | + ]; | |
| 220 | + } | |
| 221 | + | |
| 222 | + public function add_repeater_args_element_like_icon() | |
| 223 | + { | |
| 224 | + return [ | |
| 225 | + 'type' => Controls_Manager::HIDDEN, | |
| 226 | + 'default' => '' | |
| 227 | + ]; | |
| 228 | + } | |
| 229 | + | |
| 230 | + public function add_repeater_args_element_like_text() | |
| 231 | + { | |
| 232 | + return [ | |
| 233 | + 'type' => Controls_Manager::HIDDEN, | |
| 234 | + 'default' => '' | |
| 235 | + ]; | |
| 236 | + } | |
| 237 | + | |
| 238 | + public function add_repeater_args_element_like_show_count() | |
| 239 | + { | |
| 240 | + return [ | |
| 241 | + 'type' => Controls_Manager::HIDDEN, | |
| 242 | + 'default' => '' | |
| 243 | + ]; | |
| 244 | + } | |
| 245 | + | |
| 246 | + public function add_repeater_args_element_sharing_icon_1() | |
| 247 | + { | |
| 248 | + return [ | |
| 249 | + 'type' => Controls_Manager::HIDDEN, | |
| 250 | + 'default' => '' | |
| 251 | + ]; | |
| 252 | + } | |
| 253 | + | |
| 254 | + public function add_repeater_args_element_sharing_icon_2() | |
| 255 | + { | |
| 256 | + return [ | |
| 257 | + 'type' => Controls_Manager::HIDDEN, | |
| 258 | + 'default' => '' | |
| 259 | + ]; | |
| 260 | + } | |
| 261 | + | |
| 262 | + public function add_repeater_args_element_sharing_icon_3() | |
| 263 | + { | |
| 264 | + return [ | |
| 265 | + 'type' => Controls_Manager::HIDDEN, | |
| 266 | + 'default' => '' | |
| 267 | + ]; | |
| 268 | + } | |
| 269 | + | |
| 270 | + public function add_repeater_args_element_sharing_icon_4() | |
| 271 | + { | |
| 272 | + return [ | |
| 273 | + 'type' => Controls_Manager::HIDDEN, | |
| 274 | + 'default' => '' | |
| 275 | + ]; | |
| 276 | + } | |
| 277 | + | |
| 278 | + public function add_repeater_args_element_sharing_icon_5() | |
| 279 | + { | |
| 280 | + return [ | |
| 281 | + 'type' => Controls_Manager::HIDDEN, | |
| 282 | + 'default' => '' | |
| 283 | + ]; | |
| 284 | + } | |
| 285 | + | |
| 286 | + public function add_repeater_args_element_sharing_icon_6() | |
| 287 | + { | |
| 288 | + return [ | |
| 289 | + 'type' => Controls_Manager::HIDDEN, | |
| 290 | + 'default' => '' | |
| 291 | + ]; | |
| 292 | + } | |
| 293 | + | |
| 294 | + public function add_repeater_args_element_sharing_trigger() | |
| 295 | + { | |
| 296 | + return [ | |
| 297 | + 'type' => Controls_Manager::HIDDEN, | |
| 298 | + 'default' => '' | |
| 299 | + ]; | |
| 300 | + } | |
| 301 | + | |
| 302 | + public function add_repeater_args_element_sharing_trigger_icon() | |
| 303 | + { | |
| 304 | + return [ | |
| 305 | + 'type' => Controls_Manager::HIDDEN, | |
| 306 | + 'default' => '' | |
| 307 | + ]; | |
| 308 | + } | |
| 309 | + | |
| 310 | + public function add_repeater_args_element_sharing_trigger_action() | |
| 311 | + { | |
| 312 | + return [ | |
| 313 | + 'type' => Controls_Manager::HIDDEN, | |
| 314 | + 'default' => '' | |
| 315 | + ]; | |
| 316 | + } | |
| 317 | + | |
| 318 | + public function add_repeater_args_element_sharing_trigger_direction() | |
| 319 | + { | |
| 320 | + return [ | |
| 321 | + 'type' => Controls_Manager::HIDDEN, | |
| 322 | + 'default' => '' | |
| 323 | + ]; | |
| 324 | + } | |
| 325 | + | |
| 326 | + public function add_repeater_args_element_sharing_tooltip() | |
| 327 | + { | |
| 328 | + return [ | |
| 329 | + 'type' => Controls_Manager::HIDDEN, | |
| 330 | + 'default' => '' | |
| 331 | + ]; | |
| 332 | + } | |
| 333 | + | |
| 334 | + public function add_repeater_args_element_custom_field() | |
| 335 | + { | |
| 336 | + return [ | |
| 337 | + 'type' => Controls_Manager::HIDDEN, | |
| 338 | + 'default' => '' | |
| 339 | + ]; | |
| 340 | + } | |
| 341 | + | |
| 342 | + public function add_repeater_args_element_custom_field_btn_link() | |
| 343 | + { | |
| 344 | + return [ | |
| 345 | + 'type' => Controls_Manager::HIDDEN, | |
| 346 | + 'default' => '' | |
| 347 | + ]; | |
| 348 | + } | |
| 349 | + | |
| 350 | + public function add_repeater_args_element_custom_field_new_tab() | |
| 351 | + { | |
| 352 | + return [ | |
| 353 | + 'type' => Controls_Manager::HIDDEN, | |
| 354 | + 'default' => '' | |
| 355 | + ]; | |
| 356 | + } | |
| 357 | + | |
| 358 | + public function add_repeater_args_custom_field_wrapper_html_divider1() | |
| 359 | + { | |
| 360 | + return [ | |
| 361 | + 'type' => Controls_Manager::HIDDEN, | |
| 362 | + 'default' => '' | |
| 363 | + ]; | |
| 364 | + } | |
| 365 | + | |
| 366 | + public function add_repeater_args_element_custom_field_wrapper() | |
| 367 | + { | |
| 368 | + return [ | |
| 369 | + 'type' => Controls_Manager::HIDDEN, | |
| 370 | + 'default' => '' | |
| 371 | + ]; | |
| 372 | + } | |
| 373 | + | |
| 374 | + public function add_repeater_args_element_custom_field_wrapper_html() | |
| 375 | + { | |
| 376 | + return [ | |
| 377 | + 'type' => Controls_Manager::HIDDEN, | |
| 378 | + 'default' => '' | |
| 379 | + ]; | |
| 380 | + } | |
| 381 | + | |
| 382 | + public function add_repeater_args_custom_field_wrapper_html_divider2() | |
| 383 | + { | |
| 384 | + return [ | |
| 385 | + 'type' => Controls_Manager::HIDDEN, | |
| 386 | + 'default' => '' | |
| 387 | + ]; | |
| 388 | + } | |
| 389 | + | |
| 390 | + public function add_repeater_args_element_custom_field_style() | |
| 391 | + { | |
| 392 | + return [ | |
| 393 | + 'type' => Controls_Manager::HIDDEN, | |
| 394 | + 'default' => '' | |
| 395 | + ]; | |
| 396 | + } | |
| 397 | + | |
| 398 | + public function add_repeater_args_element_trim_text_by() | |
| 399 | + { | |
| 400 | + return [ | |
| 401 | + 'word_count' => esc_html__('Word Count', 'king-addons'), | |
| 402 | + 'pro-lc' => esc_html__('Letter Count (Pro)', 'king-addons') | |
| 403 | + ]; | |
| 404 | + } | |
| 405 | + | |
| 406 | + public function add_control_overlay_animation_divider() | |
| 407 | + { | |
| 408 | + } | |
| 409 | + | |
| 410 | + public function add_control_overlay_image() | |
| 411 | + { | |
| 412 | + } | |
| 413 | + | |
| 414 | + public function add_control_overlay_image_width() | |
| 415 | + { | |
| 416 | + } | |
| 417 | + | |
| 418 | + public function add_section_slider() | |
| 419 | + { | |
| 420 | + $this->start_controls_section( | |
| 421 | + 'section_slider', | |
| 422 | + [ | |
| 423 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Posts Slider', 'king-addons'), | |
| 424 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 425 | + ] | |
| 426 | + ); | |
| 427 | + | |
| 428 | + $this->add_control( | |
| 429 | + 'slider_section_pro_notice', | |
| 430 | + [ | |
| 431 | + 'raw' => 'Tiled Post Slider is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-magazine-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>', | |
| 432 | + | |
| 433 | + 'type' => Controls_Manager::RAW_HTML, | |
| 434 | + 'content_classes' => 'king-addons-pro-notice', | |
| 435 | + ] | |
| 436 | + ); | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | +$this->end_controls_section(); | |
| 442 | + | |
| 443 | + | |
| 444 | + } | |
| 445 | + | |
| 446 | + public function add_control_title_pointer_color_hr() | |
| 447 | + { | |
| 448 | + } | |
| 449 | + | |
| 450 | + public function add_control_title_pointer() | |
| 451 | + { | |
| 452 | + } | |
| 453 | + | |
| 454 | + public function add_control_title_pointer_height() | |
| 455 | + { | |
| 456 | + } | |
| 457 | + | |
| 458 | + public function add_control_title_pointer_animation() | |
| 459 | + { | |
| 460 | + } | |
| 461 | + | |
| 462 | + public function add_control_tax1_custom_colors($meta) | |
| 463 | + { | |
| 464 | + } | |
| 465 | + | |
| 466 | + public function add_control_tax1_pointer_color_hr() | |
| 467 | + { | |
| 468 | + } | |
| 469 | + | |
| 470 | + public function add_control_tax1_pointer() | |
| 471 | + { | |
| 472 | + } | |
| 473 | + | |
| 474 | + public function add_control_tax1_pointer_height() | |
| 475 | + { | |
| 476 | + } | |
| 477 | + | |
| 478 | + public function add_control_tax1_pointer_animation() | |
| 479 | + { | |
| 480 | + } | |
| 481 | + | |
| 482 | + public function add_control_tax2_pointer_color_hr() | |
| 483 | + { | |
| 484 | + } | |
| 485 | + | |
| 486 | + public function add_control_tax2_pointer() | |
| 487 | + { | |
| 488 | + } | |
| 489 | + | |
| 490 | + public function add_control_tax2_pointer_height() | |
| 491 | + { | |
| 492 | + } | |
| 493 | + | |
| 494 | + public function add_control_tax2_pointer_animation() | |
| 495 | + { | |
| 496 | + } | |
| 497 | + | |
| 498 | + public function add_control_read_more_animation() | |
| 499 | + { | |
| 500 | + } | |
| 501 | + | |
| 502 | + public function add_control_read_more_animation_height() | |
| 503 | + { | |
| 504 | + } | |
| 505 | + | |
| 506 | + public function add_section_style_custom_field1() | |
| 507 | + { | |
| 508 | + } | |
| 509 | + | |
| 510 | + public function add_section_style_custom_field2() | |
| 511 | + { | |
| 512 | + } | |
| 513 | + | |
| 514 | + public function add_section_style_grid_slider_nav() | |
| 515 | + { | |
| 516 | + } | |
| 517 | + | |
| 518 | + public function add_section_style_likes() | |
| 519 | + { | |
| 520 | + } | |
| 521 | + | |
| 522 | + public function add_section_style_sharing() | |
| 523 | + { | |
| 524 | + } | |
| 525 | + | |
| 526 | + protected function register_controls() | |
| 527 | + { | |
| 528 | + | |
| 529 | + $this->start_controls_section( | |
| 530 | + 'section_grid_query', | |
| 531 | + [ | |
| 532 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Query', 'king-addons'), | |
| 533 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 534 | + ] | |
| 535 | + ); | |
| 536 | + | |
| 537 | + $post_types = $this->add_option_query_source(); | |
| 538 | + | |
| 539 | + unset($post_types['product']); | |
| 540 | + unset($post_types['e-landing-page']); | |
| 541 | + | |
| 542 | + $post_taxonomies = $this->get_available_taxonomies(); | |
| 543 | + | |
| 544 | + $tax_meta_keys = Core::getCustomMetaKeysTaxonomies(); | |
| 545 | + | |
| 546 | + $this->add_control( | |
| 547 | + 'query_source', | |
| 548 | + [ | |
| 549 | + 'label' => esc_html__('Source', 'king-addons'), | |
| 550 | + 'type' => Controls_Manager::SELECT, | |
| 551 | + 'default' => 'post', | |
| 552 | + 'options' => $post_types, | |
| 553 | + ] | |
| 554 | + ); | |
| 555 | + | |
| 556 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'magazine-grid', 'query_source', ['pro-rl', 'pro-cr']); | |
| 557 | + | |
| 558 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 559 | + $this->add_control( | |
| 560 | + 'query_source_cpt_pro_notice', | |
| 561 | + [ | |
| 562 | + 'raw' => 'This option is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-grid-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>', | |
| 563 | + 'type' => Controls_Manager::RAW_HTML, | |
| 564 | + 'content_classes' => 'king-addons-pro-notice', | |
| 565 | + 'condition' => [ | |
| 566 | + 'query_source!' => ['post', 'page', 'related', 'current', 'pro-rl', 'pro-cr'], | |
| 567 | + ] | |
| 568 | + ] | |
| 569 | + ); | |
| 570 | + } | |
| 571 | + | |
| 572 | + $this->add_control( | |
| 573 | + 'query_selection', | |
| 574 | + [ | |
| 575 | + 'label' => esc_html__('Selection', 'king-addons'), | |
| 576 | + 'type' => Controls_Manager::SELECT, | |
| 577 | + 'default' => 'dynamic', | |
| 578 | + 'options' => [ | |
| 579 | + 'dynamic' => esc_html__('Dynamic', 'king-addons'), | |
| 580 | + 'manual' => esc_html__('Manual', 'king-addons'), | |
| 581 | + ], | |
| 582 | + 'condition' => [ | |
| 583 | + 'query_source!' => ['current', 'related'], | |
| 584 | + ], | |
| 585 | + ] | |
| 586 | + ); | |
| 587 | + | |
| 588 | + $this->add_control_order_posts(); | |
| 589 | + | |
| 590 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'order_posts', ['pro-tl', 'pro-mf', 'pro-d', 'pro-ar', 'pro-cc']); | |
| 591 | + | |
| 592 | + $this->add_control( | |
| 593 | + 'order_direction', | |
| 594 | + [ | |
| 595 | + 'label' => esc_html__('Order', 'king-addons'), | |
| 596 | + 'type' => Controls_Manager::SELECT, | |
| 597 | + 'default' => 'DESC', | |
| 598 | + 'label_block' => false, | |
| 599 | + 'options' => [ | |
| 600 | + 'ASC' => esc_html__('Ascending', 'king-addons'), | |
| 601 | + 'DESC' => esc_html__('Descending', 'king-addons'), | |
| 602 | + ], | |
| 603 | + 'condition' => [ | |
| 604 | + 'query_randomize!' => 'rand', | |
| 605 | + ] | |
| 606 | + ] | |
| 607 | + ); | |
| 608 | + | |
| 609 | + $this->add_control( | |
| 610 | + 'query_tax_selection', | |
| 611 | + [ | |
| 612 | + 'label' => esc_html__('Select Taxonomy', 'king-addons'), | |
| 613 | + 'type' => Controls_Manager::SELECT, | |
| 614 | + 'default' => 'category', | |
| 615 | + 'options' => $post_taxonomies, | |
| 616 | + 'condition' => [ | |
| 617 | + 'query_source' => 'related', | |
| 618 | + ], | |
| 619 | + ] | |
| 620 | + ); | |
| 621 | + | |
| 622 | + $this->add_control( | |
| 623 | + 'query_author', | |
| 624 | + [ | |
| 625 | + 'label' => esc_html__('Authors', 'king-addons'), | |
| 626 | + 'type' => 'king-addons-ajax-select2', | |
| 627 | + 'options' => 'ajaxselect2/getUsers', | |
| 628 | + 'multiple' => true, | |
| 629 | + 'label_block' => true, | |
| 630 | + 'separator' => 'before', | |
| 631 | + 'condition' => [ | |
| 632 | + 'query_source!' => ['current', 'related'], | |
| 633 | + 'query_selection' => 'dynamic', | |
| 634 | + ], | |
| 635 | + ] | |
| 636 | + ); | |
| 637 | + | |
| 638 | + | |
| 639 | + foreach ($post_taxonomies as $slug => $title) { | |
| 640 | + global $wp_taxonomies; | |
| 641 | + $post_type = ''; | |
| 642 | + | |
| 643 | + if (isset($wp_taxonomies[$slug]->object_type[0])) { | |
| 644 | + $post_type = $wp_taxonomies[$slug]->object_type[0]; | |
| 645 | + } | |
| 646 | + | |
| 647 | + $this->add_control( | |
| 648 | + 'query_taxonomy_' . $slug, | |
| 649 | + [ | |
| 650 | + 'label' => $title, | |
| 651 | + 'type' => 'king-addons-ajax-select2', | |
| 652 | + 'options' => 'ajaxselect2/getTaxonomies', | |
| 653 | + 'query_slug' => $slug, | |
| 654 | + 'multiple' => true, | |
| 655 | + 'label_block' => true, | |
| 656 | + 'condition' => [ | |
| 657 | + 'query_source' => $post_type, | |
| 658 | + 'query_selection' => 'dynamic', | |
| 659 | + ], | |
| 660 | + ] | |
| 661 | + ); | |
| 662 | + } | |
| 663 | + | |
| 664 | + foreach ($post_types as $slug => $title) { | |
| 665 | + $this->add_control( | |
| 666 | + 'query_exclude_' . $slug, | |
| 667 | + [ | |
| 668 | + 'label' => esc_html__('Exclude ', 'king-addons') . $title, | |
| 669 | + 'type' => 'king-addons-ajax-select2', | |
| 670 | + 'options' => 'ajaxselect2/getPostsByPostType', | |
| 671 | + 'query_slug' => $slug, | |
| 672 | + 'multiple' => true, | |
| 673 | + 'label_block' => true, | |
| 674 | + 'condition' => [ | |
| 675 | + 'query_source' => $slug, | |
| 676 | + 'query_source!' => ['current', 'related'], | |
| 677 | + 'query_selection' => 'dynamic', | |
| 678 | + ], | |
| 679 | + ] | |
| 680 | + ); | |
| 681 | + } | |
| 682 | + | |
| 683 | + foreach ($post_types as $slug => $title) { | |
| 684 | + $this->add_control( | |
| 685 | + 'query_manual_' . $slug, | |
| 686 | + [ | |
| 687 | + 'label' => esc_html__('Select ', 'king-addons') . $title, | |
| 688 | + 'type' => 'king-addons-ajax-select2', | |
| 689 | + 'options' => 'ajaxselect2/getPostsByPostType', | |
| 690 | + 'query_slug' => $slug, | |
| 691 | + 'multiple' => true, | |
| 692 | + 'label_block' => true, | |
| 693 | + 'condition' => [ | |
| 694 | + 'query_source' => $slug, | |
| 695 | + 'query_selection' => 'manual', | |
| 696 | + ], | |
| 697 | + 'separator' => 'before', | |
| 698 | + ] | |
| 699 | + ); | |
| 700 | + } | |
| 701 | + | |
| 702 | + $this->add_control( | |
| 703 | + 'query_offset', | |
| 704 | + [ | |
| 705 | + 'label' => esc_html__('Offset', 'king-addons'), | |
| 706 | + 'type' => Controls_Manager::NUMBER, | |
| 707 | + 'default' => 0, | |
| 708 | + 'min' => 0, | |
| 709 | + 'condition' => [ | |
| 710 | + 'query_selection' => 'dynamic', | |
| 711 | + ] | |
| 712 | + ] | |
| 713 | + ); | |
| 714 | + | |
| 715 | + $this->add_control( | |
| 716 | + 'query_not_found_text', | |
| 717 | + [ | |
| 718 | + 'label' => esc_html__('Not Found Text', 'king-addons'), | |
| 719 | + 'type' => Controls_Manager::TEXT, | |
| 720 | + 'dynamic' => [ | |
| 721 | + 'active' => true, | |
| 722 | + ], | |
| 723 | + 'default' => 'No Posts Found!', | |
| 724 | + 'condition' => [ | |
| 725 | + 'query_selection' => 'dynamic', | |
| 726 | + 'query_source!' => 'related', | |
| 727 | + ] | |
| 728 | + ] | |
| 729 | + ); | |
| 730 | + | |
| 731 | + $this->add_control_query_randomize(); | |
| 732 | + | |
| 733 | + $this->add_control( | |
| 734 | + 'query_exclude_no_images', | |
| 735 | + [ | |
| 736 | + 'label' => esc_html__('Exclude Items without Thumbnail', 'king-addons'), | |
| 737 | + 'type' => Controls_Manager::SWITCHER, | |
| 738 | + 'return_value' => 'yes', | |
| 739 | + 'label_block' => false | |
| 740 | + ] | |
| 741 | + ); | |
| 742 | + | |
| 743 | + $this->add_control( | |
| 744 | + 'element_select_filter', | |
| 745 | + [ | |
| 746 | + 'type' => Controls_Manager::HIDDEN, | |
| 747 | + 'default' => $this->get_related_taxonomies(), | |
| 748 | + ] | |
| 749 | + ); | |
| 750 | + | |
| 751 | + $this->end_controls_section(); | |
| 752 | + | |
| 753 | + $this->start_controls_section( | |
| 754 | + 'section_grid_layout', | |
| 755 | + [ | |
| 756 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Layout', 'king-addons'), | |
| 757 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 758 | + ] | |
| 759 | + ); | |
| 760 | + | |
| 761 | + $this->add_control( | |
| 762 | + 'king_addons_grid_layout_select', | |
| 763 | + [ | |
| 764 | + 'label' => esc_html__('Select Layout', 'king-addons'), | |
| 765 | + 'type' => Controls_Manager::CHOOSE, | |
| 766 | + 'default' => '1-1-3', | |
| 767 | + 'options' => [ | |
| 768 | + '1-2' => [ | |
| 769 | + 'title' => esc_html__('Layout 1 (3 posts) (Pro)', 'king-addons'), | |
| 770 | + ], | |
| 771 | + '1-3' => [ | |
| 772 | + 'title' => esc_html__('Layout 2 (4 posts) (Pro)', 'king-addons'), | |
| 773 | + ], | |
| 774 | + '1-4' => [ | |
| 775 | + 'title' => esc_html__('Layout 3 (5 posts) (Pro)', 'king-addons'), | |
| 776 | + ], | |
| 777 | + '1-1-2' => [ | |
| 778 | + 'title' => esc_html__('Layout 4 (4 posts) (Pro)', 'king-addons'), | |
| 779 | + ], | |
| 780 | + '2-1-2' => [ | |
| 781 | + 'title' => esc_html__('Layout 5 (5 posts) (Pro)', 'king-addons'), | |
| 782 | + ], | |
| 783 | + '1vh-3h' => [ | |
| 784 | + 'title' => esc_html__('Layout 5.0 (4 posts) (Pro)', 'king-addons'), | |
| 785 | + ], | |
| 786 | + '1-1-1' => [ | |
| 787 | + 'title' => esc_html__('Layout 5.1 (3 posts)', 'king-addons'), | |
| 788 | + ], | |
| 789 | + '1-1-3' => [ | |
| 790 | + 'title' => esc_html__('Layout 5.2 (5 posts)', 'king-addons'), | |
| 791 | + ], | |
| 792 | + '2-3' => [ | |
| 793 | + 'title' => esc_html__('Layout 6 (5 posts)', 'king-addons'), | |
| 794 | + ], | |
| 795 | + '2-h' => [ | |
| 796 | + 'title' => esc_html__('Layout 7 (2, 4, 6 posts)', 'king-addons'), | |
| 797 | + ], | |
| 798 | + '3-h' => [ | |
| 799 | + 'title' => esc_html__('Layout 8 (3, 6, 9 posts)', 'king-addons'), | |
| 800 | + ], | |
| 801 | + '4-h' => [ | |
| 802 | + 'title' => esc_html__('Layout 8 (4, 8, 12 posts)', 'king-addons'), | |
| 803 | + ] | |
| 804 | + ], | |
| 805 | + ] | |
| 806 | + ); | |
| 807 | + | |
| 808 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 809 | + $this->add_control( | |
| 810 | + 'layout_select_pro_notice', | |
| 811 | + [ | |
| 812 | + 'raw' => 'These Layout options are available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-magazine-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>', | |
| 813 | + | |
| 814 | + 'type' => Controls_Manager::RAW_HTML, | |
| 815 | + 'content_classes' => 'king-addons-pro-notice', | |
| 816 | + 'condition' => [ | |
| 817 | + 'king_addons_grid_layout_select' => ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h'] | |
| 818 | + ] | |
| 819 | + ] | |
| 820 | + ); | |
| 821 | + } | |
| 822 | + | |
| 823 | + $this->add_control_force_responsive_one_column(); | |
| 824 | + | |
| 825 | + $this->add_control_open_links_in_new_tab(); | |
| 826 | + | |
| 827 | + $this->add_group_control( | |
| 828 | + Group_Control_Image_Size::get_type(), | |
| 829 | + [ | |
| 830 | + 'name' => 'layout_image_crop', | |
| 831 | + 'default' => 'full', | |
| 832 | + ] | |
| 833 | + ); | |
| 834 | + | |
| 835 | + $this->add_control( | |
| 836 | + 'layout_rows_number', | |
| 837 | + [ | |
| 838 | + 'label' => esc_html__('Rows Number', 'king-addons'), | |
| 839 | + 'type' => Controls_Manager::SELECT, | |
| 840 | + 'render_type' => 'template', | |
| 841 | + 'default' => '1', | |
| 842 | + 'options' => [ | |
| 843 | + '1' => esc_html__('1 Row', 'king-addons'), | |
| 844 | + '2' => esc_html__('2 Rows', 'king-addons'), | |
| 845 | + '3' => esc_html__('3 Rows', 'king-addons'), | |
| 846 | + ], | |
| 847 | + 'selectors' => [ | |
| 848 | + '{{WRAPPER}} .king-addons-magazine-grid-add-2-h' => 'grid-template-rows: repeat({{VALUE}}, 1fr);', | |
| 849 | + '{{WRAPPER}} .king-addons-magazine-grid-add-3-h' => 'grid-template-rows: repeat({{VALUE}}, 1fr);', | |
| 850 | + '{{WRAPPER}} .king-addons-magazine-grid-add-4-h' => 'grid-template-rows: repeat({{VALUE}}, 1fr);', | |
| 851 | + ], | |
| 852 | + 'condition' => [ | |
| 853 | + 'king_addons_grid_layout_select' => ['2-h', '3-h', '4-h'] | |
| 854 | + ], | |
| 855 | + ] | |
| 856 | + ); | |
| 857 | + | |
| 858 | + $this->add_responsive_control( | |
| 859 | + 'layout_container_height', | |
| 860 | + [ | |
| 861 | + 'type' => Controls_Manager::SLIDER, | |
| 862 | + 'label' => esc_html__('Container Height', 'king-addons'), | |
| 863 | + 'range' => [ | |
| 864 | + 'px' => [ | |
| 865 | + 'min' => 100, | |
| 866 | + 'max' => 1500, | |
| 867 | + ], | |
| 868 | + ], | |
| 869 | + 'default' => [ | |
| 870 | + 'unit' => 'px', | |
| 871 | + 'size' => 520, | |
| 872 | + ], | |
| 873 | + 'selectors' => [ | |
| 874 | + '{{WRAPPER}} .king-addons-magazine-grid' => 'min-height: {{SIZE}}px;', | |
| 875 | + ], | |
| 876 | + 'separator' => 'before' | |
| 877 | + ] | |
| 878 | + ); | |
| 879 | + | |
| 880 | + $this->add_control( | |
| 881 | + 'layout_big_post_width', | |
| 882 | + [ | |
| 883 | + 'type' => Controls_Manager::SLIDER, | |
| 884 | + 'label' => esc_html__('Featured Box Width', 'king-addons'), | |
| 885 | + 'range' => [ | |
| 886 | + '%' => [ | |
| 887 | + 'min' => 10, | |
| 888 | + 'max' => 100, | |
| 889 | + ], | |
| 890 | + ], | |
| 891 | + 'default' => [ | |
| 892 | + 'unit' => '%', | |
| 893 | + 'size' => 50, | |
| 894 | + ], | |
| 895 | + 'selectors' => [ | |
| 896 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-2' => 'grid-template-columns: {{SIZE}}% 1fr; -ms-grid-columns: {{SIZE}}% 1fr;', | |
| 897 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-3' => 'grid-template-columns: {{SIZE}}% 1fr 1fr; -ms-grid-columns: {{SIZE}}% 1fr 1fr;', | |
| 898 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-4' => 'grid-template-columns: {{SIZE}}% 1fr 1fr; -ms-grid-columns: {{SIZE}}% 1fr 1fr;', | |
| 899 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-2' => 'grid-template-columns: {{SIZE}}% 1fr 1fr; -ms-grid-columns: {{SIZE}}% 1fr 1fr;', | |
| 900 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1vh-3h' => 'grid-template-columns: {{SIZE}}% 1fr; -ms-grid-columns: {{SIZE}}% 1fr;', | |
| 901 | + '{{WRAPPER}} .king-addons-magazine-grid-add-2-1-2' => 'grid-template-columns: 1fr {{SIZE}}% 1fr; -ms-grid-columns: 1fr {{SIZE}}% 1fr;', | |
| 902 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-1' => 'grid-template-columns: 1fr {{SIZE}}% 1fr; -ms-grid-columns: 1fr {{SIZE}}% 1fr;', | |
| 903 | + ], | |
| 904 | + 'condition' => [ | |
| 905 | + 'king_addons_grid_layout_select' => ['1-2', '1-3', '1-4', '1-1-2', '1vh-3h', '2-1-2', '1-1-1'] | |
| 906 | + ] | |
| 907 | + ] | |
| 908 | + ); | |
| 909 | + | |
| 910 | + $this->add_responsive_control( | |
| 911 | + 'layout_gutter_hr', | |
| 912 | + [ | |
| 913 | + 'label' => esc_html__('Horizontal Gutter', 'king-addons'), | |
| 914 | + 'type' => Controls_Manager::SLIDER, | |
| 915 | + 'default' => [ | |
| 916 | + 'size' => 4, | |
| 917 | + ], | |
| 918 | + 'widescreen_default' => [ | |
| 919 | + 'size' => 4, | |
| 920 | + ], | |
| 921 | + 'laptop_default' => [ | |
| 922 | + 'size' => 4, | |
| 923 | + ], | |
| 924 | + 'tablet_extra_default' => [ | |
| 925 | + 'size' => 4, | |
| 926 | + ], | |
| 927 | + 'tablet_default' => [ | |
| 928 | + 'size' => 4, | |
| 929 | + ], | |
| 930 | + 'mobile_extra_default' => [ | |
| 931 | + 'size' => 4, | |
| 932 | + ], | |
| 933 | + 'mobile_default' => [ | |
| 934 | + 'size' => 4, | |
| 935 | + ], | |
| 936 | + 'range' => [ | |
| 937 | + 'px' => [ | |
| 938 | + 'min' => 0, | |
| 939 | + 'max' => 50, | |
| 940 | + ], | |
| 941 | + ], | |
| 942 | + 'selectors' => [ | |
| 943 | + '{{WRAPPER}} .king-addons-magazine-grid' => 'grid-column-gap: {{SIZE}}px;', | |
| 944 | + ], | |
| 945 | + 'separator' => 'before' | |
| 946 | + ] | |
| 947 | + ); | |
| 948 | + | |
| 949 | + $this->add_responsive_control( | |
| 950 | + 'layout_gutter_vr', | |
| 951 | + [ | |
| 952 | + 'label' => esc_html__('Vertical Gutter', 'king-addons'), | |
| 953 | + 'type' => Controls_Manager::SLIDER, | |
| 954 | + 'default' => [ | |
| 955 | + 'size' => 4, | |
| 956 | + ], | |
| 957 | + 'widescreen_default' => [ | |
| 958 | + 'size' => 4, | |
| 959 | + ], | |
| 960 | + 'laptop_default' => [ | |
| 961 | + 'size' => 4, | |
| 962 | + ], | |
| 963 | + 'tablet_extra_default' => [ | |
| 964 | + 'size' => 4, | |
| 965 | + ], | |
| 966 | + 'tablet_default' => [ | |
| 967 | + 'size' => 4, | |
| 968 | + ], | |
| 969 | + 'mobile_extra_default' => [ | |
| 970 | + 'size' => 4, | |
| 971 | + ], | |
| 972 | + 'mobile_default' => [ | |
| 973 | + 'size' => 4, | |
| 974 | + ], | |
| 975 | + 'range' => [ | |
| 976 | + 'px' => [ | |
| 977 | + 'min' => 0, | |
| 978 | + 'max' => 50, | |
| 979 | + ], | |
| 980 | + ], | |
| 981 | + 'selectors' => [ | |
| 982 | + '{{WRAPPER}} .king-addons-magazine-grid' => 'grid-row-gap: {{SIZE}}px;', | |
| 983 | + ], | |
| 984 | + 'separator' => 'after' | |
| 985 | + ] | |
| 986 | + ); | |
| 987 | + | |
| 988 | + $this->end_controls_section(); | |
| 989 | + | |
| 990 | + | |
| 991 | + $this->start_controls_section( | |
| 992 | + 'section_grid_elements', | |
| 993 | + [ | |
| 994 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Elements', 'king-addons'), | |
| 995 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 996 | + ] | |
| 997 | + ); | |
| 998 | + | |
| 999 | + $repeater = new Repeater(); | |
| 1000 | + | |
| 1001 | + $element_select = $this->add_option_element_select(); | |
| 1002 | + | |
| 1003 | + $repeater->add_control( | |
| 1004 | + 'element_select', | |
| 1005 | + [ | |
| 1006 | + 'label' => esc_html__('Select Element', 'king-addons'), | |
| 1007 | + 'type' => Controls_Manager::SELECT, | |
| 1008 | + 'default' => 'title', | |
| 1009 | + 'options' => array_merge($element_select, $post_taxonomies), | |
| 1010 | + 'separator' => 'after' | |
| 1011 | + ] | |
| 1012 | + ); | |
| 1013 | + | |
| 1014 | + $repeater->add_control( | |
| 1015 | + 'show_last_update_date', | |
| 1016 | + [ | |
| 1017 | + 'label' => esc_html__('Show Last Update Date', 'king-addons'), | |
| 1018 | + 'type' => Controls_Manager::SWITCHER, | |
| 1019 | + 'return_value' => 'yes', | |
| 1020 | + 'separator' => 'after', | |
| 1021 | + 'condition' => [ | |
| 1022 | + 'element_select' => 'date', | |
| 1023 | + ] | |
| 1024 | + ] | |
| 1025 | + ); | |
| 1026 | + | |
| 1027 | + Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'magazine-grid', 'element_select', ['pro-lk', 'pro-shr', 'pro-cf']); | |
| 1028 | + | |
| 1029 | + $repeater->add_control( | |
| 1030 | + 'element_display', | |
| 1031 | + [ | |
| 1032 | + 'label' => esc_html__('Display', 'king-addons'), | |
| 1033 | + 'type' => Controls_Manager::SELECT, | |
| 1034 | + 'default' => 'block', | |
| 1035 | + 'options' => [ | |
| 1036 | + 'inline' => esc_html__('Inline', 'king-addons'), | |
| 1037 | + 'block' => esc_html__('Separate Line', 'king-addons'), | |
| 1038 | + 'custom' => esc_html__('Custom Width', 'king-addons'), | |
| 1039 | + ], | |
| 1040 | + ] | |
| 1041 | + ); | |
| 1042 | + | |
| 1043 | + $repeater->add_control( | |
| 1044 | + 'element_custom_width', | |
| 1045 | + [ | |
| 1046 | + 'label' => esc_html__('Element Width', 'king-addons'), | |
| 1047 | + 'type' => Controls_Manager::SLIDER, | |
| 1048 | + 'size_units' => ['%'], | |
| 1049 | + 'range' => [ | |
| 1050 | + '%' => [ | |
| 1051 | + 'min' => 0, | |
| 1052 | + 'max' => 100, | |
| 1053 | + ], | |
| 1054 | + ], | |
| 1055 | + 'default' => [ | |
| 1056 | + 'unit' => '%', | |
| 1057 | + 'size' => 100, | |
| 1058 | + ], | |
| 1059 | + 'selectors' => [ | |
| 1060 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}%;', | |
| 1061 | + ], | |
| 1062 | + 'condition' => [ | |
| 1063 | + 'element_display' => 'custom', | |
| 1064 | + ], | |
| 1065 | + ] | |
| 1066 | + ); | |
| 1067 | + | |
| 1068 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 1069 | + $repeater->add_control( | |
| 1070 | + 'element_align_pro_notice', | |
| 1071 | + [ | |
| 1072 | + 'raw' => 'Vertical Align option is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-magazine-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>', | |
| 1073 | + | |
| 1074 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1075 | + 'content_classes' => 'king-addons-pro-notice', | |
| 1076 | + ] | |
| 1077 | + ); | |
| 1078 | + } | |
| 1079 | + | |
| 1080 | + $repeater->add_control( | |
| 1081 | + 'element_align_vr', | |
| 1082 | + [ | |
| 1083 | + 'label' => esc_html__('Vertical Align', 'king-addons'), | |
| 1084 | + 'type' => Controls_Manager::CHOOSE, | |
| 1085 | + 'label_block' => false, | |
| 1086 | + 'default' => 'middle', | |
| 1087 | + 'options' => [ | |
| 1088 | + 'top' => [ | |
| 1089 | + 'title' => esc_html__('Top', 'king-addons'), | |
| 1090 | + 'icon' => 'eicon-v-align-top', | |
| 1091 | + ], | |
| 1092 | + 'middle' => [ | |
| 1093 | + 'title' => esc_html__('Middle', 'king-addons'), | |
| 1094 | + 'icon' => 'eicon-v-align-middle', | |
| 1095 | + ], | |
| 1096 | + 'bottom' => [ | |
| 1097 | + 'title' => esc_html__('Bottom', 'king-addons'), | |
| 1098 | + 'icon' => 'eicon-v-align-bottom', | |
| 1099 | + ], | |
| 1100 | + ], | |
| 1101 | + ] | |
| 1102 | + ); | |
| 1103 | + | |
| 1104 | + $repeater->add_control( | |
| 1105 | + 'element_align_hr', | |
| 1106 | + [ | |
| 1107 | + 'label' => esc_html__('Horizontal Align', 'king-addons'), | |
| 1108 | + 'type' => Controls_Manager::CHOOSE, | |
| 1109 | + 'label_block' => false, | |
| 1110 | + 'default' => 'center', | |
| 1111 | + 'options' => [ | |
| 1112 | + 'left' => [ | |
| 1113 | + 'title' => esc_html__('Left', 'king-addons'), | |
| 1114 | + 'icon' => 'eicon-h-align-left', | |
| 1115 | + ], | |
| 1116 | + 'center' => [ | |
| 1117 | + 'title' => esc_html__('Center', 'king-addons'), | |
| 1118 | + 'icon' => 'eicon-h-align-center', | |
| 1119 | + ], | |
| 1120 | + 'right' => [ | |
| 1121 | + 'title' => esc_html__('Right', 'king-addons'), | |
| 1122 | + 'icon' => 'eicon-h-align-right', | |
| 1123 | + ] | |
| 1124 | + ], | |
| 1125 | + 'selectors' => [ | |
| 1126 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => 'text-align: {{VALUE}}', | |
| 1127 | + ], | |
| 1128 | + 'render_type' => 'template', | |
| 1129 | + 'separator' => 'after' | |
| 1130 | + ] | |
| 1131 | + ); | |
| 1132 | + | |
| 1133 | + $repeater->add_control( | |
| 1134 | + 'element_title_tag', | |
| 1135 | + [ | |
| 1136 | + 'label' => esc_html__('Title HTML Tag', 'king-addons'), | |
| 1137 | + 'type' => Controls_Manager::SELECT, | |
| 1138 | + 'options' => [ | |
| 1139 | + 'h1' => 'H1', | |
| 1140 | + 'h2' => 'H2', | |
| 1141 | + 'h3' => 'H3', | |
| 1142 | + 'h4' => 'H4', | |
| 1143 | + 'h5' => 'H5', | |
| 1144 | + 'h6' => 'H6', | |
| 1145 | + 'div' => 'div', | |
| 1146 | + 'span' => 'span', | |
| 1147 | + 'P' => 'p' | |
| 1148 | + ], | |
| 1149 | + 'default' => 'h2', | |
| 1150 | + 'condition' => [ | |
| 1151 | + 'element_select' => 'title', | |
| 1152 | + ] | |
| 1153 | + ] | |
| 1154 | + ); | |
| 1155 | + | |
| 1156 | + $repeater->add_control( | |
| 1157 | + 'element_dropcap', | |
| 1158 | + [ | |
| 1159 | + 'label' => esc_html__('Enable Drop Cap', 'king-addons'), | |
| 1160 | + 'type' => Controls_Manager::SWITCHER, | |
| 1161 | + 'return_value' => 'yes', | |
| 1162 | + 'condition' => [ | |
| 1163 | + 'element_select' => ['content', 'excerpt'], | |
| 1164 | + ] | |
| 1165 | + ] | |
| 1166 | + ); | |
| 1167 | + | |
| 1168 | + $repeater->add_control( | |
| 1169 | + 'element_trim_text_by', | |
| 1170 | + [ | |
| 1171 | + 'label' => esc_html__('Trim Text By', 'king-addons'), | |
| 1172 | + 'type' => Controls_Manager::SELECT, | |
| 1173 | + 'default' => 'word_count', | |
| 1174 | + 'options' => $this->add_repeater_args_element_trim_text_by(), | |
| 1175 | + 'separator' => 'after', | |
| 1176 | + 'condition' => [ | |
| 1177 | + 'element_select' => ['title', 'excerpt'], | |
| 1178 | + ] | |
| 1179 | + ] | |
| 1180 | + ); | |
| 1181 | + | |
| 1182 | + $repeater->add_control( | |
| 1183 | + 'element_word_count', | |
| 1184 | + [ | |
| 1185 | + 'label' => esc_html__('Word Count', 'king-addons'), | |
| 1186 | + 'type' => Controls_Manager::NUMBER, | |
| 1187 | + 'default' => 20, | |
| 1188 | + 'min' => 1, | |
| 1189 | + 'condition' => [ | |
| 1190 | + 'element_select' => ['title', 'excerpt'], | |
| 1191 | + 'element_trim_text_by' => 'word_count' | |
| 1192 | + ] | |
| 1193 | + ] | |
| 1194 | + ); | |
| 1195 | + | |
| 1196 | + $repeater->add_control( | |
| 1197 | + 'element_letter_count', | |
| 1198 | + [ | |
| 1199 | + 'label' => esc_html__('Letter Count', 'king-addons'), | |
| 1200 | + 'type' => Controls_Manager::NUMBER, | |
| 1201 | + 'default' => 40, | |
| 1202 | + 'min' => 1, | |
| 1203 | + 'condition' => [ | |
| 1204 | + 'element_select' => ['title', 'excerpt'], | |
| 1205 | + 'element_trim_text_by' => 'letter_count' | |
| 1206 | + ] | |
| 1207 | + ] | |
| 1208 | + ); | |
| 1209 | + | |
| 1210 | + $repeater->add_control( | |
| 1211 | + 'element_show_avatar', | |
| 1212 | + [ | |
| 1213 | + 'label' => esc_html__('Show Avatar', 'king-addons'), | |
| 1214 | + 'type' => Controls_Manager::SWITCHER, | |
| 1215 | + 'return_value' => 'yes', | |
| 1216 | + 'condition' => [ | |
| 1217 | + 'element_select' => ['author'] | |
| 1218 | + ] | |
| 1219 | + ] | |
| 1220 | + ); | |
| 1221 | + | |
| 1222 | + $repeater->add_control( | |
| 1223 | + 'element_avatar_size', | |
| 1224 | + [ | |
| 1225 | + 'label' => esc_html__('Avatar Size', 'king-addons'), | |
| 1226 | + 'type' => Controls_Manager::NUMBER, | |
| 1227 | + 'default' => 32, | |
| 1228 | + 'min' => 8, | |
| 1229 | + 'condition' => [ | |
| 1230 | + 'element_select' => ['author'], | |
| 1231 | + 'element_show_avatar' => 'yes' | |
| 1232 | + ], | |
| 1233 | + 'separator' => 'after' | |
| 1234 | + ] | |
| 1235 | + ); | |
| 1236 | + | |
| 1237 | + $repeater->add_control( | |
| 1238 | + 'element_read_more_text', | |
| 1239 | + [ | |
| 1240 | + 'label' => esc_html__('Read More Text', 'king-addons'), | |
| 1241 | + 'type' => Controls_Manager::TEXT, | |
| 1242 | + 'dynamic' => [ | |
| 1243 | + 'active' => true, | |
| 1244 | + ], | |
| 1245 | + 'default' => 'Read More', | |
| 1246 | + 'condition' => [ | |
| 1247 | + 'element_select' => ['read-more'], | |
| 1248 | + ], | |
| 1249 | + 'separator' => 'after' | |
| 1250 | + ] | |
| 1251 | + ); | |
| 1252 | + | |
| 1253 | + $repeater->add_control( | |
| 1254 | + 'element_tax_sep', | |
| 1255 | + [ | |
| 1256 | + 'label' => esc_html__('Separator', 'king-addons'), | |
| 1257 | + 'type' => Controls_Manager::TEXT, | |
| 1258 | + 'dynamic' => [ | |
| 1259 | + 'active' => true, | |
| 1260 | + ], | |
| 1261 | + 'default' => ', ', | |
| 1262 | + 'condition' => [ | |
| 1263 | + 'element_select!' => [ | |
| 1264 | + 'title', | |
| 1265 | + 'content', | |
| 1266 | + 'excerpt', | |
| 1267 | + 'date', | |
| 1268 | + 'time', | |
| 1269 | + 'author', | |
| 1270 | + 'comments', | |
| 1271 | + 'read-more', | |
| 1272 | + 'likes', | |
| 1273 | + 'sharing', | |
| 1274 | + 'custom-field', | |
| 1275 | + 'separator', | |
| 1276 | + 'post_format', | |
| 1277 | + ], | |
| 1278 | + ], | |
| 1279 | + 'separator' => 'after' | |
| 1280 | + ] | |
| 1281 | + ); | |
| 1282 | + | |
| 1283 | + $repeater->add_control( | |
| 1284 | + 'element_tax_style', | |
| 1285 | + [ | |
| 1286 | + 'label' => esc_html__('Select Styling', 'king-addons'), | |
| 1287 | + 'type' => Controls_Manager::SELECT, | |
| 1288 | + 'default' => 'king-addons-grid-tax-style-1', | |
| 1289 | + 'options' => [ | |
| 1290 | + 'king-addons-grid-tax-style-1' => esc_html__('Taxonomy Style 1', 'king-addons'), | |
| 1291 | + 'king-addons-grid-tax-style-2' => esc_html__('Taxonomy Style 2', 'king-addons'), | |
| 1292 | + ], | |
| 1293 | + 'condition' => [ | |
| 1294 | + 'element_select!' => [ | |
| 1295 | + 'title', | |
| 1296 | + 'content', | |
| 1297 | + 'excerpt', | |
| 1298 | + 'date', | |
| 1299 | + 'time', | |
| 1300 | + 'author', | |
| 1301 | + 'comments', | |
| 1302 | + 'read-more', | |
| 1303 | + 'likes', | |
| 1304 | + 'sharing', | |
| 1305 | + 'custom-field', | |
| 1306 | + 'separator', | |
| 1307 | + ], | |
| 1308 | + ], | |
| 1309 | + 'separator' => 'after' | |
| 1310 | + ] | |
| 1311 | + ); | |
| 1312 | + | |
| 1313 | + $repeater->add_control( | |
| 1314 | + 'element_comments_text_1', | |
| 1315 | + [ | |
| 1316 | + 'label' => esc_html__('No Comments', 'king-addons'), | |
| 1317 | + 'type' => Controls_Manager::TEXT, | |
| 1318 | + 'dynamic' => [ | |
| 1319 | + 'active' => true, | |
| 1320 | + ], | |
| 1321 | + 'default' => 'No Comments', | |
| 1322 | + 'condition' => [ | |
| 1323 | + 'element_select' => ['comments'], | |
| 1324 | + ] | |
| 1325 | + ] | |
| 1326 | + ); | |
| 1327 | + | |
| 1328 | + $repeater->add_control( | |
| 1329 | + 'element_comments_text_2', | |
| 1330 | + [ | |
| 1331 | + 'label' => esc_html__('One Comment', 'king-addons'), | |
| 1332 | + 'type' => Controls_Manager::TEXT, | |
| 1333 | + 'dynamic' => [ | |
| 1334 | + 'active' => true, | |
| 1335 | + ], | |
| 1336 | + 'default' => 'Comment', | |
| 1337 | + 'condition' => [ | |
| 1338 | + 'element_select' => ['comments'], | |
| 1339 | + ] | |
| 1340 | + ] | |
| 1341 | + ); | |
| 1342 | + | |
| 1343 | + $repeater->add_control( | |
| 1344 | + 'element_comments_text_3', | |
| 1345 | + [ | |
| 1346 | + 'label' => esc_html__('Multiple Comments', 'king-addons'), | |
| 1347 | + 'type' => Controls_Manager::TEXT, | |
| 1348 | + 'dynamic' => [ | |
| 1349 | + 'active' => true, | |
| 1350 | + ], | |
| 1351 | + 'default' => 'Comments', | |
| 1352 | + 'condition' => [ | |
| 1353 | + 'element_select' => ['comments'], | |
| 1354 | + ], | |
| 1355 | + 'separator' => 'after' | |
| 1356 | + ] | |
| 1357 | + ); | |
| 1358 | + | |
| 1359 | + $repeater->add_control('element_like_icon', $this->add_repeater_args_element_like_icon()); | |
| 1360 | + | |
| 1361 | + $repeater->add_control('element_like_show_count', $this->add_repeater_args_element_like_show_count()); | |
| 1362 | + | |
| 1363 | + $repeater->add_control('element_like_text', $this->add_repeater_args_element_like_text()); | |
| 1364 | + | |
| 1365 | + $repeater->add_control('element_sharing_icon_1', $this->add_repeater_args_element_sharing_icon_1()); | |
| 1366 | + | |
| 1367 | + $repeater->add_control('element_sharing_icon_2', $this->add_repeater_args_element_sharing_icon_2()); | |
| 1368 | + | |
| 1369 | + $repeater->add_control('element_sharing_icon_3', $this->add_repeater_args_element_sharing_icon_3()); | |
| 1370 | + | |
| 1371 | + $repeater->add_control('element_sharing_icon_4', $this->add_repeater_args_element_sharing_icon_4()); | |
| 1372 | + | |
| 1373 | + $repeater->add_control('element_sharing_icon_5', $this->add_repeater_args_element_sharing_icon_5()); | |
| 1374 | + | |
| 1375 | + $repeater->add_control('element_sharing_icon_6', $this->add_repeater_args_element_sharing_icon_6()); | |
| 1376 | + | |
| 1377 | + $repeater->add_control('element_sharing_trigger', $this->add_repeater_args_element_sharing_trigger()); | |
| 1378 | + | |
| 1379 | + $repeater->add_control('element_sharing_trigger_icon', $this->add_repeater_args_element_sharing_trigger_icon()); | |
| 1380 | + | |
| 1381 | + $repeater->add_control('element_sharing_trigger_action', $this->add_repeater_args_element_sharing_trigger_action()); | |
| 1382 | + | |
| 1383 | + $repeater->add_control('element_sharing_trigger_direction', $this->add_repeater_args_element_sharing_trigger_direction()); | |
| 1384 | + | |
| 1385 | + $repeater->add_control('element_sharing_tooltip', $this->add_repeater_args_element_sharing_tooltip()); | |
| 1386 | + | |
| 1387 | + $repeater->add_control('element_custom_field', $this->add_repeater_args_element_custom_field()); | |
| 1388 | + | |
| 1389 | + $repeater->add_control('element_custom_field_btn_link', $this->add_repeater_args_element_custom_field_btn_link()); | |
| 1390 | + | |
| 1391 | + $repeater->add_control('element_custom_field_new_tab', $this->add_repeater_args_element_custom_field_new_tab()); | |
| 1392 | + | |
| 1393 | + $repeater->add_control('custom_field_wrapper_html_divider1', $this->add_repeater_args_custom_field_wrapper_html_divider1()); | |
| 1394 | + | |
| 1395 | + $repeater->add_control('element_custom_field_wrapper', $this->add_repeater_args_element_custom_field_wrapper()); | |
| 1396 | + | |
| 1397 | + $repeater->add_control('element_custom_field_wrapper_html', $this->add_repeater_args_element_custom_field_wrapper_html()); | |
| 1398 | + | |
| 1399 | + $repeater->add_control('custom_field_wrapper_html_divider2', $this->add_repeater_args_custom_field_wrapper_html_divider2()); | |
| 1400 | + | |
| 1401 | + $repeater->add_control('element_custom_field_style', $this->add_repeater_args_element_custom_field_style()); | |
| 1402 | + | |
| 1403 | + $repeater->add_control( | |
| 1404 | + 'element_separator_style', | |
| 1405 | + [ | |
| 1406 | + 'label' => esc_html__('Select Styling', 'king-addons'), | |
| 1407 | + 'type' => Controls_Manager::SELECT, | |
| 1408 | + 'default' => 'king-addons-grid-sep-style-1', | |
| 1409 | + 'options' => [ | |
| 1410 | + 'king-addons-grid-sep-style-1' => esc_html__('Separator Style 1', 'king-addons'), | |
| 1411 | + 'king-addons-grid-sep-style-2' => esc_html__('Separator Style 2', 'king-addons'), | |
| 1412 | + ], | |
| 1413 | + 'condition' => [ | |
| 1414 | + 'element_select' => 'separator', | |
| 1415 | + ] | |
| 1416 | + ] | |
| 1417 | + ); | |
| 1418 | + | |
| 1419 | + $repeater->add_control( | |
| 1420 | + 'element_extra_text_pos', | |
| 1421 | + [ | |
| 1422 | + 'label' => esc_html__('Extra Text Display', 'king-addons'), | |
| 1423 | + 'type' => Controls_Manager::SELECT, | |
| 1424 | + 'options' => [ | |
| 1425 | + 'none' => esc_html__('None', 'king-addons'), | |
| 1426 | + 'before' => esc_html__('Before Element', 'king-addons'), | |
| 1427 | + 'after' => esc_html__('After Element', 'king-addons'), | |
| 1428 | + ], | |
| 1429 | + 'default' => 'none', | |
| 1430 | + 'condition' => [ | |
| 1431 | + 'element_select!' => [ | |
| 1432 | + 'title', | |
| 1433 | + 'content', | |
| 1434 | + 'excerpt', | |
| 1435 | + 'read-more', | |
| 1436 | + 'separator', | |
| 1437 | + ], | |
| 1438 | + ] | |
| 1439 | + ] | |
| 1440 | + ); | |
| 1441 | + | |
| 1442 | + $repeater->add_control( | |
| 1443 | + 'element_extra_text', | |
| 1444 | + [ | |
| 1445 | + 'label' => esc_html__('Extra Text', 'king-addons'), | |
| 1446 | + 'type' => Controls_Manager::TEXT, | |
| 1447 | + 'dynamic' => [ | |
| 1448 | + 'active' => true, | |
| 1449 | + ], | |
| 1450 | + 'default' => '', | |
| 1451 | + 'condition' => [ | |
| 1452 | + 'element_select!' => [ | |
| 1453 | + 'title', | |
| 1454 | + 'content', | |
| 1455 | + 'excerpt', | |
| 1456 | + 'read-more', | |
| 1457 | + 'separator', | |
| 1458 | + ], | |
| 1459 | + 'element_extra_text_pos!' => 'none' | |
| 1460 | + ] | |
| 1461 | + ] | |
| 1462 | + ); | |
| 1463 | + | |
| 1464 | + $repeater->add_control( | |
| 1465 | + 'element_extra_icon_pos', | |
| 1466 | + [ | |
| 1467 | + 'label' => esc_html__('Extra Icon Position', 'king-addons'), | |
| 1468 | + 'type' => Controls_Manager::SELECT, | |
| 1469 | + 'options' => [ | |
| 1470 | + 'none' => esc_html__('None', 'king-addons'), | |
| 1471 | + 'before' => esc_html__('Before Element', 'king-addons'), | |
| 1472 | + 'after' => esc_html__('After Element', 'king-addons'), | |
| 1473 | + ], | |
| 1474 | + 'default' => 'none', | |
| 1475 | + 'condition' => [ | |
| 1476 | + 'element_select!' => [ | |
| 1477 | + 'title', | |
| 1478 | + 'content', | |
| 1479 | + 'excerpt', | |
| 1480 | + 'separator', | |
| 1481 | + 'likes', | |
| 1482 | + 'sharing', | |
| 1483 | + ], | |
| 1484 | + ] | |
| 1485 | + ] | |
| 1486 | + ); | |
| 1487 | + | |
| 1488 | + $repeater->add_control( | |
| 1489 | + 'element_extra_icon', | |
| 1490 | + [ | |
| 1491 | + 'label' => esc_html__('Select Icon', 'king-addons'), | |
| 1492 | + 'type' => Controls_Manager::ICONS, | |
| 1493 | + 'skin' => 'inline', | |
| 1494 | + 'label_block' => false, | |
| 1495 | + 'condition' => [ | |
| 1496 | + 'element_select!' => [ | |
| 1497 | + 'title', | |
| 1498 | + 'content', | |
| 1499 | + 'excerpt', | |
| 1500 | + 'separator', | |
| 1501 | + 'likes', | |
| 1502 | + 'sharing', | |
| 1503 | + ], | |
| 1504 | + 'element_extra_icon_pos!' => 'none' | |
| 1505 | + ] | |
| 1506 | + ] | |
| 1507 | + ); | |
| 1508 | + | |
| 1509 | + $repeater->add_control( | |
| 1510 | + 'animation_divider', | |
| 1511 | + [ | |
| 1512 | + 'type' => Controls_Manager::DIVIDER, | |
| 1513 | + 'style' => 'thick', | |
| 1514 | + ] | |
| 1515 | + ); | |
| 1516 | + | |
| 1517 | + $repeater->add_control( | |
| 1518 | + 'element_animation', | |
| 1519 | + [ | |
| 1520 | + 'label' => esc_html__('Select Animation', 'king-addons'), | |
| 1521 | + 'type' => 'king-addons-animations', | |
| 1522 | + 'default' => 'none', | |
| 1523 | + ] | |
| 1524 | + ); | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'magazine-grid', 'element_animation', ['pro-slrt', 'pro-slxrt', 'pro-slbt', 'pro-sllt', 'pro-sltp', 'pro-slxlt', 'pro-sktp', 'pro-skrt', 'pro-skbt', 'pro-sklt', 'pro-scup', 'pro-scdn', 'pro-rllt', 'pro-rlrt']); | |
| 1528 | + | |
| 1529 | + $repeater->add_control( | |
| 1530 | + 'element_animation_duration', | |
| 1531 | + [ | |
| 1532 | + 'label' => esc_html__('Animation Duration', 'king-addons'), | |
| 1533 | + 'type' => Controls_Manager::NUMBER, | |
| 1534 | + 'default' => 0.3, | |
| 1535 | + 'min' => 0, | |
| 1536 | + 'max' => 5, | |
| 1537 | + 'step' => 0.1, | |
| 1538 | + 'selectors' => [ | |
| 1539 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => 'transition-duration: {{VALUE}}s;' | |
| 1540 | + ], | |
| 1541 | + 'condition' => [ | |
| 1542 | + 'element_animation!' => 'none', | |
| 1543 | + ], | |
| 1544 | + ] | |
| 1545 | + ); | |
| 1546 | + | |
| 1547 | + $repeater->add_control( | |
| 1548 | + 'element_animation_delay', | |
| 1549 | + [ | |
| 1550 | + 'label' => esc_html__('Animation Delay', 'king-addons'), | |
| 1551 | + 'type' => Controls_Manager::NUMBER, | |
| 1552 | + 'default' => 0, | |
| 1553 | + 'min' => 0, | |
| 1554 | + 'max' => 5, | |
| 1555 | + 'step' => 0.1, | |
| 1556 | + 'selectors' => [ | |
| 1557 | + '{{WRAPPER}} .king-addons-animation-wrap:hover {{CURRENT_ITEM}}' => 'transition-delay: {{VALUE}}s;' | |
| 1558 | + ], | |
| 1559 | + 'condition' => [ | |
| 1560 | + 'element_animation!' => 'none', | |
| 1561 | + ], | |
| 1562 | + ] | |
| 1563 | + ); | |
| 1564 | + | |
| 1565 | + $repeater->add_control( | |
| 1566 | + 'element_animation_timing', | |
| 1567 | + [ | |
| 1568 | + 'label' => esc_html__('Animation Timing', 'king-addons'), | |
| 1569 | + 'type' => Controls_Manager::SELECT, | |
| 1570 | + 'options' => Core::getAnimationTimings(), | |
| 1571 | + 'default' => 'ease-default', | |
| 1572 | + 'condition' => [ | |
| 1573 | + 'element_animation!' => 'none', | |
| 1574 | + ], | |
| 1575 | + ] | |
| 1576 | + ); | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'magazine-grid', 'element_animation_timing', ['pro-eio', 'pro-eiqd', 'pro-eicb', 'pro-eiqrt', 'pro-eiqnt', 'pro-eisn', 'pro-eiex', 'pro-eicr', 'pro-eibk', 'pro-eoqd', 'pro-eocb', 'pro-eoqrt', 'pro-eoqnt', 'pro-eosn', 'pro-eoex', 'pro-eocr', 'pro-eobk', 'pro-eioqd', 'pro-eiocb', 'pro-eioqrt', 'pro-eioqnt', 'pro-eiosn', 'pro-eioex', 'pro-eiocr', 'pro-eiobk',]); | |
| 1580 | + | |
| 1581 | + $repeater->add_control( | |
| 1582 | + 'element_animation_size', | |
| 1583 | + [ | |
| 1584 | + 'label' => esc_html__('Animation Size', 'king-addons'), | |
| 1585 | + 'type' => Controls_Manager::SELECT, | |
| 1586 | + 'options' => [ | |
| 1587 | + 'small' => esc_html__('Small', 'king-addons'), | |
| 1588 | + 'medium' => esc_html__('Medium', 'king-addons'), | |
| 1589 | + 'large' => esc_html__('Large', 'king-addons'), | |
| 1590 | + ], | |
| 1591 | + 'default' => 'medium', | |
| 1592 | + 'condition' => [ | |
| 1593 | + 'element_animation!' => 'none', | |
| 1594 | + ], | |
| 1595 | + ] | |
| 1596 | + ); | |
| 1597 | + | |
| 1598 | + $repeater->add_control( | |
| 1599 | + 'element_animation_tr', | |
| 1600 | + [ | |
| 1601 | + 'label' => esc_html__('Animation Transparency', 'king-addons'), | |
| 1602 | + 'type' => Controls_Manager::SWITCHER, | |
| 1603 | + 'default' => 'yes', | |
| 1604 | + 'return_value' => 'yes', | |
| 1605 | + 'condition' => [ | |
| 1606 | + 'element_animation!' => 'none', | |
| 1607 | + ], | |
| 1608 | + ] | |
| 1609 | + ); | |
| 1610 | + | |
| 1611 | + $repeater->add_responsive_control( | |
| 1612 | + 'element_show_on', | |
| 1613 | + [ | |
| 1614 | + 'label' => esc_html__('Show on this Device', 'king-addons'), | |
| 1615 | + 'type' => Controls_Manager::SWITCHER, | |
| 1616 | + 'default' => 'yes', | |
| 1617 | + 'widescreen_default' => 'yes', | |
| 1618 | + 'laptop_default' => 'yes', | |
| 1619 | + 'tablet_extra_default' => 'yes', | |
| 1620 | + 'tablet_default' => 'yes', | |
| 1621 | + 'mobile_extra_default' => 'yes', | |
| 1622 | + 'mobile_default' => 'yes', | |
| 1623 | + 'selectors_dictionary' => [ | |
| 1624 | + '' => 'position: absolute; left: -99999999px;', | |
| 1625 | + 'yes' => 'position: static; left: auto;' | |
| 1626 | + ], | |
| 1627 | + 'selectors' => [ | |
| 1628 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => '{{VALUE}}', | |
| 1629 | + ], | |
| 1630 | + 'render_type' => 'template', | |
| 1631 | + ] | |
| 1632 | + ); | |
| 1633 | + | |
| 1634 | + $this->add_control( | |
| 1635 | + 'grid_elements', | |
| 1636 | + [ | |
| 1637 | + 'label' => esc_html__('Grid Elements', 'king-addons'), | |
| 1638 | + 'type' => Controls_Manager::REPEATER, | |
| 1639 | + 'fields' => $repeater->get_controls(), | |
| 1640 | + 'default' => [ | |
| 1641 | + [ | |
| 1642 | + 'element_select' => 'category', | |
| 1643 | + 'element_align_vr' => 'bottom', | |
| 1644 | + 'element_align_hr' => 'left', | |
| 1645 | + ], | |
| 1646 | + [ | |
| 1647 | + 'element_select' => 'title', | |
| 1648 | + 'element_align_vr' => 'bottom', | |
| 1649 | + 'element_align_hr' => 'left', | |
| 1650 | + ], | |
| 1651 | + [ | |
| 1652 | + 'element_select' => 'date', | |
| 1653 | + 'element_align_vr' => 'bottom', | |
| 1654 | + 'element_display' => 'inline', | |
| 1655 | + 'element_align_hr' => 'left', | |
| 1656 | + ], | |
| 1657 | + ], | |
| 1658 | + 'title_field' => '{{ element_select.charAt(0).toUpperCase() + element_select.slice(1) }}', | |
| 1659 | + ] | |
| 1660 | + ); | |
| 1661 | + | |
| 1662 | + $this->end_controls_section(); | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + $this->add_section_slider(); | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + $this->start_controls_section( | |
| 1669 | + 'section_image_overlay', | |
| 1670 | + [ | |
| 1671 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'), | |
| 1672 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 1673 | + ] | |
| 1674 | + ); | |
| 1675 | + | |
| 1676 | + $this->add_control( | |
| 1677 | + 'overlay_width', | |
| 1678 | + [ | |
| 1679 | + 'label' => esc_html__('Overlay Width', 'king-addons'), | |
| 1680 | + 'type' => Controls_Manager::SLIDER, | |
| 1681 | + 'size_units' => ['%', 'px'], | |
| 1682 | + 'default' => [ | |
| 1683 | + 'unit' => '%', | |
| 1684 | + 'size' => 100, | |
| 1685 | + ], | |
| 1686 | + 'range' => [ | |
| 1687 | + '%' => [ | |
| 1688 | + 'min' => 0, | |
| 1689 | + 'max' => 100, | |
| 1690 | + ], | |
| 1691 | + 'px' => [ | |
| 1692 | + 'min' => 0, | |
| 1693 | + 'max' => 500, | |
| 1694 | + ], | |
| 1695 | + ], | |
| 1696 | + 'selectors' => [ | |
| 1697 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'width: {{SIZE}}{{UNIT}};top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);', | |
| 1698 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-top"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);', | |
| 1699 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-bottom"]' => 'bottom:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);', | |
| 1700 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-right"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);right:calc((100% - {{SIZE}}{{UNIT}})/2);', | |
| 1701 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-left"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);', | |
| 1702 | + ], | |
| 1703 | + ] | |
| 1704 | + ); | |
| 1705 | + | |
| 1706 | + $this->add_responsive_control( | |
| 1707 | + 'overlay_height', | |
| 1708 | + [ | |
| 1709 | + 'label' => esc_html__('Overlay Height', 'king-addons'), | |
| 1710 | + 'type' => Controls_Manager::SLIDER, | |
| 1711 | + 'size_units' => ['%', 'px'], | |
| 1712 | + 'default' => [ | |
| 1713 | + 'unit' => '%', | |
| 1714 | + 'size' => 100, | |
| 1715 | + ], | |
| 1716 | + 'range' => [ | |
| 1717 | + '%' => [ | |
| 1718 | + 'min' => 0, | |
| 1719 | + 'max' => 100, | |
| 1720 | + ], | |
| 1721 | + 'px' => [ | |
| 1722 | + 'min' => 0, | |
| 1723 | + 'max' => 500, | |
| 1724 | + ], | |
| 1725 | + ], | |
| 1726 | + 'selectors' => [ | |
| 1727 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'height: {{SIZE}}{{UNIT}};top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);', | |
| 1728 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-top"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);', | |
| 1729 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-bottom"]' => 'bottom:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);', | |
| 1730 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-right"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);right:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);', | |
| 1731 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-left"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);', | |
| 1732 | + ], | |
| 1733 | + 'separator' => 'after', | |
| 1734 | + ] | |
| 1735 | + ); | |
| 1736 | + | |
| 1737 | + $this->add_control( | |
| 1738 | + 'overlay_post_link', | |
| 1739 | + [ | |
| 1740 | + 'label' => esc_html__('Link to Single Page', 'king-addons'), | |
| 1741 | + 'type' => Controls_Manager::SWITCHER, | |
| 1742 | + 'default' => 'yes', | |
| 1743 | + 'return_value' => 'yes', | |
| 1744 | + 'separator' => 'after', | |
| 1745 | + ] | |
| 1746 | + ); | |
| 1747 | + | |
| 1748 | + $this->add_control( | |
| 1749 | + 'overlay_animation', | |
| 1750 | + [ | |
| 1751 | + 'label' => esc_html__('Select Animation', 'king-addons'), | |
| 1752 | + 'type' => 'king-addons-animations-alt', | |
| 1753 | + 'default' => 'fade-out', | |
| 1754 | + ] | |
| 1755 | + ); | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'magazine-grid', 'overlay_animation', ['pro-slrt', 'pro-slxrt', 'pro-slbt', 'pro-sllt', 'pro-sltp', 'pro-slxlt', 'pro-sktp', 'pro-skrt', 'pro-skbt', 'pro-sklt', 'pro-scup', 'pro-scdn', 'pro-rllt', 'pro-rlrt']); | |
| 1759 | + | |
| 1760 | + $this->add_control( | |
| 1761 | + 'overlay_animation_duration', | |
| 1762 | + [ | |
| 1763 | + 'label' => esc_html__('Animation Duration', 'king-addons'), | |
| 1764 | + 'type' => Controls_Manager::NUMBER, | |
| 1765 | + 'default' => 0.7, | |
| 1766 | + 'min' => 0, | |
| 1767 | + 'max' => 5, | |
| 1768 | + 'step' => 0.1, | |
| 1769 | + 'selectors' => [ | |
| 1770 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'transition-duration: {{VALUE}}s;' | |
| 1771 | + ], | |
| 1772 | + 'condition' => [ | |
| 1773 | + 'overlay_animation!' => 'none', | |
| 1774 | + ], | |
| 1775 | + ] | |
| 1776 | + ); | |
| 1777 | + | |
| 1778 | + $this->add_control( | |
| 1779 | + 'overlay_animation_delay', | |
| 1780 | + [ | |
| 1781 | + 'label' => esc_html__('Animation Delay', 'king-addons'), | |
| 1782 | + 'type' => Controls_Manager::NUMBER, | |
| 1783 | + 'default' => 0, | |
| 1784 | + 'min' => 0, | |
| 1785 | + 'max' => 5, | |
| 1786 | + 'step' => 0.1, | |
| 1787 | + 'selectors' => [ | |
| 1788 | + '{{WRAPPER}} .king-addons-animation-wrap:hover .king-addons-grid-media-hover-bg' => 'transition-delay: {{VALUE}}s;' | |
| 1789 | + ], | |
| 1790 | + 'condition' => [ | |
| 1791 | + 'overlay_animation!' => 'none', | |
| 1792 | + ], | |
| 1793 | + ] | |
| 1794 | + ); | |
| 1795 | + | |
| 1796 | + $this->add_control( | |
| 1797 | + 'overlay_animation_timing', | |
| 1798 | + [ | |
| 1799 | + 'label' => esc_html__('Animation Timing', 'king-addons'), | |
| 1800 | + 'type' => Controls_Manager::SELECT, | |
| 1801 | + 'options' => Core::getAnimationTimings(), | |
| 1802 | + 'default' => 'ease-default', | |
| 1803 | + 'condition' => [ | |
| 1804 | + 'overlay_animation!' => 'none', | |
| 1805 | + ], | |
| 1806 | + ] | |
| 1807 | + ); | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'magazine-grid', 'overlay_animation_timing', ['pro-eio', 'pro-eiqd', 'pro-eicb', 'pro-eiqrt', 'pro-eiqnt', 'pro-eisn', 'pro-eiex', 'pro-eicr', 'pro-eibk', 'pro-eoqd', 'pro-eocb', 'pro-eoqrt', 'pro-eoqnt', 'pro-eosn', 'pro-eoex', 'pro-eocr', 'pro-eobk', 'pro-eioqd', 'pro-eiocb', 'pro-eioqrt', 'pro-eioqnt', 'pro-eiosn', 'pro-eioex', 'pro-eiocr', 'pro-eiobk',]); | |
| 1811 | + | |
| 1812 | + $this->add_control( | |
| 1813 | + 'overlay_animation_size', | |
| 1814 | + [ | |
| 1815 | + 'label' => esc_html__('Animation Size', 'king-addons'), | |
| 1816 | + 'type' => Controls_Manager::SELECT, | |
| 1817 | + 'options' => [ | |
| 1818 | + 'small' => esc_html__('Small', 'king-addons'), | |
| 1819 | + 'medium' => esc_html__('Medium', 'king-addons'), | |
| 1820 | + 'large' => esc_html__('Large', 'king-addons'), | |
| 1821 | + ], | |
| 1822 | + 'default' => 'medium', | |
| 1823 | + 'condition' => [ | |
| 1824 | + 'overlay_animation!' => 'none', | |
| 1825 | + ], | |
| 1826 | + ] | |
| 1827 | + ); | |
| 1828 | + | |
| 1829 | + $this->add_control( | |
| 1830 | + 'overlay_animation_tr', | |
| 1831 | + [ | |
| 1832 | + 'label' => esc_html__('Animation Transparency', 'king-addons'), | |
| 1833 | + 'type' => Controls_Manager::SWITCHER, | |
| 1834 | + 'default' => 'yes', | |
| 1835 | + 'return_value' => 'yes', | |
| 1836 | + 'separator' => 'after', | |
| 1837 | + 'condition' => [ | |
| 1838 | + 'overlay_animation!' => 'none', | |
| 1839 | + ], | |
| 1840 | + ] | |
| 1841 | + ); | |
| 1842 | + | |
| 1843 | + $this->add_control_overlay_animation_divider(); | |
| 1844 | + | |
| 1845 | + $this->add_control_overlay_image(); | |
| 1846 | + | |
| 1847 | + $this->add_control_overlay_image_width(); | |
| 1848 | + | |
| 1849 | + $this->end_controls_section(); | |
| 1850 | + | |
| 1851 | + Core::renderProFeaturesSection($this, '', Controls_Manager::RAW_HTML, 'magazine-grid', [ | |
| 1852 | + 'Magazine Grid Slider', | |
| 1853 | + '+6 Magazine Grid Layouts', | |
| 1854 | + 'Magazine Grid Slider Autoplay Options', | |
| 1855 | + 'Magazine Grid Slider Advanced Navigation Positioning', | |
| 1856 | + 'Magazine Grid Slider Advanced Pagination Positioning', | |
| 1857 | + 'Random Posts Query', | |
| 1858 | + 'Posts Order', | |
| 1859 | + 'Trim Title & Excerpt By Letter Count', | |
| 1860 | + 'Custom Post Types Support', | |
| 1861 | + 'Custom Fields Support', | |
| 1862 | + 'Advanced Grid Elements Positioning', | |
| 1863 | + 'Advanced Post Likes', | |
| 1864 | + 'Advanced Post Sharing', | |
| 1865 | + 'Unlimited Image Overlay Animations', | |
| 1866 | + 'Image Overlay GIF Upload Option', | |
| 1867 | + 'Title, Category, Read More Advanced Link Hover Animations', | |
| 1868 | + 'Open Links in New Tab' | |
| 1869 | + ]); | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + $this->start_controls_section( | |
| 1873 | + 'section_style_grid_media', | |
| 1874 | + [ | |
| 1875 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Grid Media', 'king-addons'), | |
| 1876 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1877 | + 'show_label' => false, | |
| 1878 | + ] | |
| 1879 | + ); | |
| 1880 | + | |
| 1881 | + $this->add_control( | |
| 1882 | + 'grid_media_border_color', | |
| 1883 | + [ | |
| 1884 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 1885 | + 'type' => Controls_Manager::COLOR, | |
| 1886 | + 'default' => '#E8E8E8', | |
| 1887 | + 'selectors' => [ | |
| 1888 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-color: {{VALUE}}', | |
| 1889 | + ], | |
| 1890 | + ] | |
| 1891 | + ); | |
| 1892 | + | |
| 1893 | + $this->add_control( | |
| 1894 | + 'grid_media_border_type', | |
| 1895 | + [ | |
| 1896 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 1897 | + 'type' => Controls_Manager::SELECT, | |
| 1898 | + 'options' => [ | |
| 1899 | + 'none' => esc_html__('None', 'king-addons'), | |
| 1900 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 1901 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 1902 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 1903 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 1904 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 1905 | + ], | |
| 1906 | + 'default' => 'none', | |
| 1907 | + 'selectors' => [ | |
| 1908 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-style: {{VALUE}};', | |
| 1909 | + ], | |
| 1910 | + ] | |
| 1911 | + ); | |
| 1912 | + | |
| 1913 | + $this->add_control( | |
| 1914 | + 'grid_media_border_width', | |
| 1915 | + [ | |
| 1916 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 1917 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1918 | + 'size_units' => ['px'], | |
| 1919 | + 'default' => [ | |
| 1920 | + 'top' => 1, | |
| 1921 | + 'right' => 1, | |
| 1922 | + 'bottom' => 1, | |
| 1923 | + 'left' => 1, | |
| 1924 | + ], | |
| 1925 | + 'selectors' => [ | |
| 1926 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1927 | + ], | |
| 1928 | + 'condition' => [ | |
| 1929 | + 'grid_media_border_type!' => 'none', | |
| 1930 | + ], | |
| 1931 | + ] | |
| 1932 | + ); | |
| 1933 | + | |
| 1934 | + $this->add_control( | |
| 1935 | + 'grid_media_radius', | |
| 1936 | + [ | |
| 1937 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 1938 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1939 | + 'size_units' => ['px', '%'], | |
| 1940 | + 'default' => [ | |
| 1941 | + 'top' => 0, | |
| 1942 | + 'right' => 0, | |
| 1943 | + 'bottom' => 0, | |
| 1944 | + 'left' => 0, | |
| 1945 | + ], | |
| 1946 | + 'selectors' => [ | |
| 1947 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1948 | + ], | |
| 1949 | + 'separator' => 'before', | |
| 1950 | + ] | |
| 1951 | + ); | |
| 1952 | + | |
| 1953 | + $this->end_controls_section(); | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + $this->start_controls_section( | |
| 1957 | + 'section_style_overlay', | |
| 1958 | + [ | |
| 1959 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'), | |
| 1960 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1961 | + 'show_label' => false, | |
| 1962 | + ] | |
| 1963 | + ); | |
| 1964 | + | |
| 1965 | + $this->add_group_control( | |
| 1966 | + Group_Control_Background::get_type(), | |
| 1967 | + [ | |
| 1968 | + 'name' => 'overlay_color', | |
| 1969 | + 'label' => esc_html__('Background', 'king-addons'), | |
| 1970 | + 'types' => ['classic', 'gradient'], | |
| 1971 | + 'fields_options' => [ | |
| 1972 | + 'background' => [ | |
| 1973 | + 'default' => 'gradient', | |
| 1974 | + ], | |
| 1975 | + 'color' => [ | |
| 1976 | + 'default' => 'rgba(255, 255, 255, 0)', | |
| 1977 | + ], | |
| 1978 | + 'color_stop' => [ | |
| 1979 | + 'default' => [ | |
| 1980 | + 'unit' => '%', | |
| 1981 | + 'size' => 0, | |
| 1982 | + ] | |
| 1983 | + ], | |
| 1984 | + 'color_b' => [ | |
| 1985 | + 'default' => 'rgba(0, 0, 0, 1)', | |
| 1986 | + ] | |
| 1987 | + ], | |
| 1988 | + 'selector' => '{{WRAPPER}} .king-addons-grid-media-hover-bg' | |
| 1989 | + ] | |
| 1990 | + ); | |
| 1991 | + | |
| 1992 | + $this->add_control( | |
| 1993 | + 'overlay_border_color', | |
| 1994 | + [ | |
| 1995 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 1996 | + 'type' => Controls_Manager::COLOR, | |
| 1997 | + 'default' => '#E8E8E8', | |
| 1998 | + 'selectors' => [ | |
| 1999 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-color: {{VALUE}}', | |
| 2000 | + ], | |
| 2001 | + ] | |
| 2002 | + ); | |
| 2003 | + | |
| 2004 | + $this->add_control( | |
| 2005 | + 'overlay_border_type', | |
| 2006 | + [ | |
| 2007 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 2008 | + 'type' => Controls_Manager::SELECT, | |
| 2009 | + 'options' => [ | |
| 2010 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2011 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 2012 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 2013 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 2014 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 2015 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 2016 | + ], | |
| 2017 | + 'default' => 'none', | |
| 2018 | + 'selectors' => [ | |
| 2019 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-style: {{VALUE}};', | |
| 2020 | + ], | |
| 2021 | + ] | |
| 2022 | + ); | |
| 2023 | + | |
| 2024 | + $this->add_control( | |
| 2025 | + 'overlay_border_width', | |
| 2026 | + [ | |
| 2027 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 2028 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2029 | + 'size_units' => ['px'], | |
| 2030 | + 'default' => [ | |
| 2031 | + 'top' => 1, | |
| 2032 | + 'right' => 1, | |
| 2033 | + 'bottom' => 1, | |
| 2034 | + 'left' => 1, | |
| 2035 | + ], | |
| 2036 | + 'selectors' => [ | |
| 2037 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2038 | + ], | |
| 2039 | + 'condition' => [ | |
| 2040 | + 'overlay_border_type!' => 'none', | |
| 2041 | + ], | |
| 2042 | + ] | |
| 2043 | + ); | |
| 2044 | + | |
| 2045 | + $this->add_control( | |
| 2046 | + 'overlay_radius', | |
| 2047 | + [ | |
| 2048 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 2049 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2050 | + 'size_units' => ['px', '%'], | |
| 2051 | + 'default' => [ | |
| 2052 | + 'top' => 0, | |
| 2053 | + 'right' => 0, | |
| 2054 | + 'bottom' => 0, | |
| 2055 | + 'left' => 0, | |
| 2056 | + ], | |
| 2057 | + 'selectors' => [ | |
| 2058 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2059 | + ], | |
| 2060 | + 'separator' => 'before', | |
| 2061 | + ] | |
| 2062 | + ); | |
| 2063 | + | |
| 2064 | + $this->end_controls_section(); | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + $this->start_controls_section( | |
| 2068 | + 'section_style_title', | |
| 2069 | + [ | |
| 2070 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Title', 'king-addons'), | |
| 2071 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 2072 | + 'show_label' => false, | |
| 2073 | + ] | |
| 2074 | + ); | |
| 2075 | + | |
| 2076 | + $this->start_controls_tabs('tabs_grid_title_style'); | |
| 2077 | + | |
| 2078 | + $this->start_controls_tab( | |
| 2079 | + 'tab_grid_title_normal', | |
| 2080 | + [ | |
| 2081 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 2082 | + ] | |
| 2083 | + ); | |
| 2084 | + | |
| 2085 | + $this->add_control( | |
| 2086 | + 'title_color', | |
| 2087 | + [ | |
| 2088 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 2089 | + 'type' => Controls_Manager::COLOR, | |
| 2090 | + 'default' => '#ffffff', | |
| 2091 | + 'selectors' => [ | |
| 2092 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'color: {{VALUE}}', | |
| 2093 | + ], | |
| 2094 | + ] | |
| 2095 | + ); | |
| 2096 | + | |
| 2097 | + $this->add_control( | |
| 2098 | + 'title_bg_color', | |
| 2099 | + [ | |
| 2100 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 2101 | + 'type' => Controls_Manager::COLOR, | |
| 2102 | + 'selectors' => [ | |
| 2103 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'background-color: {{VALUE}}', | |
| 2104 | + ] | |
| 2105 | + ] | |
| 2106 | + ); | |
| 2107 | + | |
| 2108 | + $this->add_control( | |
| 2109 | + 'title_border_color', | |
| 2110 | + [ | |
| 2111 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 2112 | + 'type' => Controls_Manager::COLOR, | |
| 2113 | + 'default' => '#E8E8E8', | |
| 2114 | + 'selectors' => [ | |
| 2115 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-color: {{VALUE}}', | |
| 2116 | + ], | |
| 2117 | + 'separator' => 'after', | |
| 2118 | + ] | |
| 2119 | + ); | |
| 2120 | + | |
| 2121 | + $this->end_controls_tab(); | |
| 2122 | + | |
| 2123 | + $this->start_controls_tab( | |
| 2124 | + 'tab_grid_title_hover', | |
| 2125 | + [ | |
| 2126 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 2127 | + ] | |
| 2128 | + ); | |
| 2129 | + | |
| 2130 | + $this->add_control( | |
| 2131 | + 'title_color_hr', | |
| 2132 | + [ | |
| 2133 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 2134 | + 'type' => Controls_Manager::COLOR, | |
| 2135 | + 'default' => '#FFFFFF', | |
| 2136 | + 'selectors' => [ | |
| 2137 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'color: {{VALUE}}', | |
| 2138 | + ], | |
| 2139 | + ] | |
| 2140 | + ); | |
| 2141 | + | |
| 2142 | + $this->add_control( | |
| 2143 | + 'title_bg_color_hr', | |
| 2144 | + [ | |
| 2145 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 2146 | + 'type' => Controls_Manager::COLOR, | |
| 2147 | + 'selectors' => [ | |
| 2148 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 2149 | + ] | |
| 2150 | + ] | |
| 2151 | + ); | |
| 2152 | + | |
| 2153 | + $this->add_control( | |
| 2154 | + 'title_border_color_hr', | |
| 2155 | + [ | |
| 2156 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 2157 | + 'type' => Controls_Manager::COLOR, | |
| 2158 | + 'default' => '#E8E8E8', | |
| 2159 | + 'selectors' => [ | |
| 2160 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 2161 | + ], | |
| 2162 | + ] | |
| 2163 | + ); | |
| 2164 | + | |
| 2165 | + $this->add_control_title_pointer_color_hr(); | |
| 2166 | + | |
| 2167 | + $this->end_controls_tab(); | |
| 2168 | + | |
| 2169 | + $this->end_controls_tabs(); | |
| 2170 | + | |
| 2171 | + $this->add_control_title_pointer(); | |
| 2172 | + | |
| 2173 | + $this->add_control_title_pointer_height(); | |
| 2174 | + | |
| 2175 | + $this->add_control_title_pointer_animation(); | |
| 2176 | + | |
| 2177 | + $this->add_control( | |
| 2178 | + 'title_transition_duration', | |
| 2179 | + [ | |
| 2180 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 2181 | + 'type' => Controls_Manager::NUMBER, | |
| 2182 | + 'default' => 0.1, | |
| 2183 | + 'min' => 0, | |
| 2184 | + 'max' => 5, | |
| 2185 | + 'step' => 0.1, | |
| 2186 | + 'selectors' => [ | |
| 2187 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 2188 | + '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s', | |
| 2189 | + '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s', | |
| 2190 | + ], | |
| 2191 | + 'separator' => 'after', | |
| 2192 | + ] | |
| 2193 | + ); | |
| 2194 | + | |
| 2195 | + $this->add_group_control( | |
| 2196 | + Group_Control_Typography::get_type(), | |
| 2197 | + [ | |
| 2198 | + 'name' => 'title_typography', | |
| 2199 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-title a' | |
| 2200 | + ] | |
| 2201 | + ); | |
| 2202 | + | |
| 2203 | + $this->add_responsive_control( | |
| 2204 | + 'title_featured_box_size', | |
| 2205 | + [ | |
| 2206 | + 'type' => Controls_Manager::SLIDER, | |
| 2207 | + 'label' => esc_html__('Featured Box Title Font Size', 'king-addons'), | |
| 2208 | + 'range' => [ | |
| 2209 | + 'px' => [ | |
| 2210 | + 'min' => 10, | |
| 2211 | + 'max' => 100, | |
| 2212 | + ], | |
| 2213 | + ], | |
| 2214 | + 'default' => [ | |
| 2215 | + 'unit' => 'px', | |
| 2216 | + 'size' => 38, | |
| 2217 | + ], | |
| 2218 | + 'selectors' => [ | |
| 2219 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-2 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;', | |
| 2220 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-3 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;', | |
| 2221 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-4 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;', | |
| 2222 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-2 article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;', | |
| 2223 | + '{{WRAPPER}} .king-addons-magazine-grid-add-2-1-2 article:nth-child(2) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;', | |
| 2224 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1vh-3h article:nth-child(1) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;', | |
| 2225 | + '{{WRAPPER}} .king-addons-magazine-grid-add-1-1-1 article:nth-child(2) .king-addons-grid-item-title a' => 'font-size: {{SIZE}}px;', | |
| 2226 | + ], | |
| 2227 | + 'condition' => [ | |
| 2228 | + 'king_addons_grid_layout_select' => ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h', '1-1-1'] | |
| 2229 | + ] | |
| 2230 | + ] | |
| 2231 | + ); | |
| 2232 | + | |
| 2233 | + $this->add_control( | |
| 2234 | + 'title_border_type', | |
| 2235 | + [ | |
| 2236 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 2237 | + 'type' => Controls_Manager::SELECT, | |
| 2238 | + 'options' => [ | |
| 2239 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2240 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 2241 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 2242 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 2243 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 2244 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 2245 | + ], | |
| 2246 | + 'default' => 'none', | |
| 2247 | + 'selectors' => [ | |
| 2248 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-style: {{VALUE}};', | |
| 2249 | + ], | |
| 2250 | + 'render_type' => 'template', | |
| 2251 | + 'separator' => 'before', | |
| 2252 | + ] | |
| 2253 | + ); | |
| 2254 | + | |
| 2255 | + $this->add_control( | |
| 2256 | + 'title_border_width', | |
| 2257 | + [ | |
| 2258 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 2259 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2260 | + 'size_units' => ['px'], | |
| 2261 | + 'default' => [ | |
| 2262 | + 'top' => 1, | |
| 2263 | + 'right' => 1, | |
| 2264 | + 'bottom' => 1, | |
| 2265 | + 'left' => 1, | |
| 2266 | + ], | |
| 2267 | + 'selectors' => [ | |
| 2268 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2269 | + ], | |
| 2270 | + 'render_type' => 'template', | |
| 2271 | + 'condition' => [ | |
| 2272 | + 'title_border_type!' => 'none', | |
| 2273 | + ], | |
| 2274 | + ] | |
| 2275 | + ); | |
| 2276 | + | |
| 2277 | + $this->add_responsive_control( | |
| 2278 | + 'title_padding', | |
| 2279 | + [ | |
| 2280 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 2281 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2282 | + 'size_units' => ['px', '%'], | |
| 2283 | + 'default' => [ | |
| 2284 | + 'top' => 0, | |
| 2285 | + 'right' => 0, | |
| 2286 | + 'bottom' => 0, | |
| 2287 | + 'left' => 0, | |
| 2288 | + ], | |
| 2289 | + 'selectors' => [ | |
| 2290 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2291 | + ], | |
| 2292 | + 'render_type' => 'template', | |
| 2293 | + 'separator' => 'before', | |
| 2294 | + ] | |
| 2295 | + ); | |
| 2296 | + | |
| 2297 | + $this->add_responsive_control( | |
| 2298 | + 'title_margin', | |
| 2299 | + [ | |
| 2300 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 2301 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2302 | + 'size_units' => ['px', '%'], | |
| 2303 | + 'default' => [ | |
| 2304 | + 'top' => 0, | |
| 2305 | + 'right' => 0, | |
| 2306 | + 'bottom' => 5, | |
| 2307 | + 'left' => 20, | |
| 2308 | + ], | |
| 2309 | + 'selectors' => [ | |
| 2310 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2311 | + ], | |
| 2312 | + 'render_type' => 'template', | |
| 2313 | + ] | |
| 2314 | + ); | |
| 2315 | + | |
| 2316 | + $this->end_controls_section(); | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + $this->start_controls_section( | |
| 2320 | + 'section_style_content', | |
| 2321 | + [ | |
| 2322 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Content', 'king-addons'), | |
| 2323 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 2324 | + 'show_label' => false, | |
| 2325 | + ] | |
| 2326 | + ); | |
| 2327 | + | |
| 2328 | + $this->add_control( | |
| 2329 | + 'content_color', | |
| 2330 | + [ | |
| 2331 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 2332 | + 'type' => Controls_Manager::COLOR, | |
| 2333 | + 'default' => '#ffffff', | |
| 2334 | + 'selectors' => [ | |
| 2335 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'color: {{VALUE}}', | |
| 2336 | + ], | |
| 2337 | + ] | |
| 2338 | + ); | |
| 2339 | + | |
| 2340 | + $this->add_control( | |
| 2341 | + 'content_dropcap_color', | |
| 2342 | + [ | |
| 2343 | + 'label' => esc_html__('DropCap Color', 'king-addons'), | |
| 2344 | + 'type' => Controls_Manager::COLOR, | |
| 2345 | + 'default' => '#3a3a3a', | |
| 2346 | + 'selectors' => [ | |
| 2347 | + '{{WRAPPER}} .king-addons-grid-item-content.king-addons-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}', | |
| 2348 | + ], | |
| 2349 | + ] | |
| 2350 | + ); | |
| 2351 | + | |
| 2352 | + $this->add_control( | |
| 2353 | + 'content_bg_color', | |
| 2354 | + [ | |
| 2355 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 2356 | + 'type' => Controls_Manager::COLOR, | |
| 2357 | + 'selectors' => [ | |
| 2358 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'background-color: {{VALUE}}', | |
| 2359 | + ] | |
| 2360 | + ] | |
| 2361 | + ); | |
| 2362 | + | |
| 2363 | + $this->add_control( | |
| 2364 | + 'content_border_color', | |
| 2365 | + [ | |
| 2366 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 2367 | + 'type' => Controls_Manager::COLOR, | |
| 2368 | + 'default' => '#E8E8E8', | |
| 2369 | + 'selectors' => [ | |
| 2370 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-color: {{VALUE}}', | |
| 2371 | + ], | |
| 2372 | + 'separator' => 'after', | |
| 2373 | + ] | |
| 2374 | + ); | |
| 2375 | + | |
| 2376 | + $this->add_group_control( | |
| 2377 | + Group_Control_Typography::get_type(), | |
| 2378 | + [ | |
| 2379 | + 'name' => 'content_typography', | |
| 2380 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-content' | |
| 2381 | + ] | |
| 2382 | + ); | |
| 2383 | + | |
| 2384 | + $this->add_group_control( | |
| 2385 | + Group_Control_Typography::get_type(), | |
| 2386 | + [ | |
| 2387 | + 'name' => 'content_dropcap_typography', | |
| 2388 | + 'label' => esc_html__('Drop Cap Typography', 'king-addons'), | |
| 2389 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-content.king-addons-enable-dropcap p:first-child:first-letter' | |
| 2390 | + ] | |
| 2391 | + ); | |
| 2392 | + | |
| 2393 | + $this->add_responsive_control( | |
| 2394 | + 'content_justify', | |
| 2395 | + [ | |
| 2396 | + 'label' => esc_html__('Justify Text', 'king-addons'), | |
| 2397 | + 'type' => Controls_Manager::SWITCHER, | |
| 2398 | + 'default' => '', | |
| 2399 | + 'widescreen_default' => '', | |
| 2400 | + 'laptop_default' => '', | |
| 2401 | + 'tablet_extra_default' => '', | |
| 2402 | + 'tablet_default' => '', | |
| 2403 | + 'mobile_extra_default' => '', | |
| 2404 | + 'mobile_default' => '', | |
| 2405 | + 'selectors_dictionary' => [ | |
| 2406 | + '' => '', | |
| 2407 | + 'yes' => 'text-align: justify;' | |
| 2408 | + ], | |
| 2409 | + 'selectors' => [ | |
| 2410 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => '{{VALUE}}', | |
| 2411 | + ], | |
| 2412 | + 'render_type' => 'template', | |
| 2413 | + ] | |
| 2414 | + ); | |
| 2415 | + | |
| 2416 | + $this->add_control( | |
| 2417 | + 'content_border_type', | |
| 2418 | + [ | |
| 2419 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 2420 | + 'type' => Controls_Manager::SELECT, | |
| 2421 | + 'options' => [ | |
| 2422 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2423 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 2424 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 2425 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 2426 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 2427 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 2428 | + ], | |
| 2429 | + 'default' => 'none', | |
| 2430 | + 'selectors' => [ | |
| 2431 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-style: {{VALUE}};', | |
| 2432 | + ], | |
| 2433 | + 'render_type' => 'template', | |
| 2434 | + 'separator' => 'before', | |
| 2435 | + ] | |
| 2436 | + ); | |
| 2437 | + | |
| 2438 | + $this->add_control( | |
| 2439 | + 'content_border_width', | |
| 2440 | + [ | |
| 2441 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 2442 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2443 | + 'size_units' => ['px'], | |
| 2444 | + 'default' => [ | |
| 2445 | + 'top' => 1, | |
| 2446 | + 'right' => 1, | |
| 2447 | + 'bottom' => 1, | |
| 2448 | + 'left' => 1, | |
| 2449 | + ], | |
| 2450 | + 'selectors' => [ | |
| 2451 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2452 | + ], | |
| 2453 | + 'render_type' => 'template', | |
| 2454 | + 'condition' => [ | |
| 2455 | + 'content_border_type!' => 'none', | |
| 2456 | + ], | |
| 2457 | + ] | |
| 2458 | + ); | |
| 2459 | + | |
| 2460 | + $this->add_responsive_control( | |
| 2461 | + 'content_padding', | |
| 2462 | + [ | |
| 2463 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 2464 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2465 | + 'size_units' => ['px', '%'], | |
| 2466 | + 'default' => [ | |
| 2467 | + 'top' => 0, | |
| 2468 | + 'right' => 0, | |
| 2469 | + 'bottom' => 0, | |
| 2470 | + 'left' => 0, | |
| 2471 | + ], | |
| 2472 | + 'selectors' => [ | |
| 2473 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2474 | + ], | |
| 2475 | + 'render_type' => 'template', | |
| 2476 | + 'separator' => 'before', | |
| 2477 | + ] | |
| 2478 | + ); | |
| 2479 | + | |
| 2480 | + $this->add_responsive_control( | |
| 2481 | + 'content_margin', | |
| 2482 | + [ | |
| 2483 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 2484 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2485 | + 'size_units' => ['px', '%'], | |
| 2486 | + 'default' => [ | |
| 2487 | + 'top' => 0, | |
| 2488 | + 'right' => 0, | |
| 2489 | + 'bottom' => 0, | |
| 2490 | + 'left' => 0, | |
| 2491 | + ], | |
| 2492 | + 'render_type' => 'template', | |
| 2493 | + 'selectors' => [ | |
| 2494 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2495 | + ], | |
| 2496 | + ] | |
| 2497 | + ); | |
| 2498 | + | |
| 2499 | + $this->end_controls_section(); | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + $this->start_controls_section( | |
| 2503 | + 'section_style_excerpt', | |
| 2504 | + [ | |
| 2505 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Excerpt', 'king-addons'), | |
| 2506 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 2507 | + 'show_label' => false, | |
| 2508 | + ] | |
| 2509 | + ); | |
| 2510 | + | |
| 2511 | + $this->add_control( | |
| 2512 | + 'excerpt_color', | |
| 2513 | + [ | |
| 2514 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 2515 | + 'type' => Controls_Manager::COLOR, | |
| 2516 | + 'default' => '#ffffff', | |
| 2517 | + 'selectors' => [ | |
| 2518 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'color: {{VALUE}}', | |
| 2519 | + ], | |
| 2520 | + ] | |
| 2521 | + ); | |
| 2522 | + | |
| 2523 | + $this->add_control( | |
| 2524 | + 'excerpt_dropcap_color', | |
| 2525 | + [ | |
| 2526 | + 'label' => esc_html__('DropCap Color', 'king-addons'), | |
| 2527 | + 'type' => Controls_Manager::COLOR, | |
| 2528 | + 'default' => '#3a3a3a', | |
| 2529 | + 'selectors' => [ | |
| 2530 | + '{{WRAPPER}} .king-addons-grid-item-excerpt.king-addons-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}', | |
| 2531 | + ], | |
| 2532 | + ] | |
| 2533 | + ); | |
| 2534 | + | |
| 2535 | + $this->add_control( | |
| 2536 | + 'excerpt_bg_color', | |
| 2537 | + [ | |
| 2538 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 2539 | + 'type' => Controls_Manager::COLOR, | |
| 2540 | + 'selectors' => [ | |
| 2541 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'background-color: {{VALUE}}', | |
| 2542 | + ] | |
| 2543 | + ] | |
| 2544 | + ); | |
| 2545 | + | |
| 2546 | + $this->add_control( | |
| 2547 | + 'excerpt_border_color', | |
| 2548 | + [ | |
| 2549 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 2550 | + 'type' => Controls_Manager::COLOR, | |
| 2551 | + 'default' => '#E8E8E8', | |
| 2552 | + 'selectors' => [ | |
| 2553 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-color: {{VALUE}}', | |
| 2554 | + ], | |
| 2555 | + 'separator' => 'after', | |
| 2556 | + ] | |
| 2557 | + ); | |
| 2558 | + | |
| 2559 | + $this->add_group_control( | |
| 2560 | + Group_Control_Typography::get_type(), | |
| 2561 | + [ | |
| 2562 | + 'name' => 'excerpt_typography', | |
| 2563 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-excerpt' | |
| 2564 | + ] | |
| 2565 | + ); | |
| 2566 | + | |
| 2567 | + $this->add_group_control( | |
| 2568 | + Group_Control_Typography::get_type(), | |
| 2569 | + [ | |
| 2570 | + 'name' => 'excerpt_dropcap_typography', | |
| 2571 | + 'label' => esc_html__('Drop Cap Typography', 'king-addons'), | |
| 2572 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-excerpt.king-addons-enable-dropcap p:first-child:first-letter' | |
| 2573 | + ] | |
| 2574 | + ); | |
| 2575 | + | |
| 2576 | + $this->add_responsive_control( | |
| 2577 | + 'excerpt_justify', | |
| 2578 | + [ | |
| 2579 | + 'label' => esc_html__('Justify Text', 'king-addons'), | |
| 2580 | + 'type' => Controls_Manager::SWITCHER, | |
| 2581 | + 'default' => '', | |
| 2582 | + 'widescreen_default' => '', | |
| 2583 | + 'laptop_default' => '', | |
| 2584 | + 'tablet_extra_default' => '', | |
| 2585 | + 'tablet_default' => '', | |
| 2586 | + 'mobile_extra_default' => '', | |
| 2587 | + 'mobile_default' => '', | |
| 2588 | + 'selectors_dictionary' => [ | |
| 2589 | + '' => '', | |
| 2590 | + 'yes' => 'text-align: justify;' | |
| 2591 | + ], | |
| 2592 | + 'selectors' => [ | |
| 2593 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => '{{VALUE}}', | |
| 2594 | + ], | |
| 2595 | + 'render_type' => 'template', | |
| 2596 | + ] | |
| 2597 | + ); | |
| 2598 | + | |
| 2599 | + $this->add_control( | |
| 2600 | + 'excerpt_border_type', | |
| 2601 | + [ | |
| 2602 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 2603 | + 'type' => Controls_Manager::SELECT, | |
| 2604 | + 'options' => [ | |
| 2605 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2606 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 2607 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 2608 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 2609 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 2610 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 2611 | + ], | |
| 2612 | + 'default' => 'none', | |
| 2613 | + 'selectors' => [ | |
| 2614 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-style: {{VALUE}};', | |
| 2615 | + ], | |
| 2616 | + 'render_type' => 'template', | |
| 2617 | + 'separator' => 'before', | |
| 2618 | + ] | |
| 2619 | + ); | |
| 2620 | + | |
| 2621 | + $this->add_control( | |
| 2622 | + 'excerpt_border_width', | |
| 2623 | + [ | |
| 2624 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 2625 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2626 | + 'size_units' => ['px'], | |
| 2627 | + 'default' => [ | |
| 2628 | + 'top' => 1, | |
| 2629 | + 'right' => 1, | |
| 2630 | + 'bottom' => 1, | |
| 2631 | + 'left' => 1, | |
| 2632 | + ], | |
| 2633 | + 'selectors' => [ | |
| 2634 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2635 | + ], | |
| 2636 | + 'render_type' => 'template', | |
| 2637 | + 'condition' => [ | |
| 2638 | + 'excerpt_border_type!' => 'none', | |
| 2639 | + ], | |
| 2640 | + ] | |
| 2641 | + ); | |
| 2642 | + | |
| 2643 | + $this->add_responsive_control( | |
| 2644 | + 'excerpt_padding', | |
| 2645 | + [ | |
| 2646 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 2647 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2648 | + 'size_units' => ['px', '%'], | |
| 2649 | + 'default' => [ | |
| 2650 | + 'top' => 0, | |
| 2651 | + 'right' => 0, | |
| 2652 | + 'bottom' => 0, | |
| 2653 | + 'left' => 0, | |
| 2654 | + ], | |
| 2655 | + 'selectors' => [ | |
| 2656 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2657 | + ], | |
| 2658 | + 'render_type' => 'template', | |
| 2659 | + 'separator' => 'before', | |
| 2660 | + ] | |
| 2661 | + ); | |
| 2662 | + | |
| 2663 | + $this->add_responsive_control( | |
| 2664 | + 'excerpt_margin', | |
| 2665 | + [ | |
| 2666 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 2667 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2668 | + 'size_units' => ['px', '%'], | |
| 2669 | + 'default' => [ | |
| 2670 | + 'top' => 0, | |
| 2671 | + 'right' => 0, | |
| 2672 | + 'bottom' => 0, | |
| 2673 | + 'left' => 0, | |
| 2674 | + ], | |
| 2675 | + 'render_type' => 'template', | |
| 2676 | + 'selectors' => [ | |
| 2677 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2678 | + ], | |
| 2679 | + ] | |
| 2680 | + ); | |
| 2681 | + | |
| 2682 | + $this->end_controls_section(); | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + $this->start_controls_section( | |
| 2686 | + 'section_style_date', | |
| 2687 | + [ | |
| 2688 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Date', 'king-addons'), | |
| 2689 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 2690 | + 'show_label' => false, | |
| 2691 | + ] | |
| 2692 | + ); | |
| 2693 | + | |
| 2694 | + $this->add_control( | |
| 2695 | + 'date_color', | |
| 2696 | + [ | |
| 2697 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 2698 | + 'type' => Controls_Manager::COLOR, | |
| 2699 | + 'default' => '#ffffff', | |
| 2700 | + 'selectors' => [ | |
| 2701 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block' => 'color: {{VALUE}}', | |
| 2702 | + ], | |
| 2703 | + ] | |
| 2704 | + ); | |
| 2705 | + | |
| 2706 | + $this->add_control( | |
| 2707 | + 'date_bg_color', | |
| 2708 | + [ | |
| 2709 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 2710 | + 'type' => Controls_Manager::COLOR, | |
| 2711 | + 'selectors' => [ | |
| 2712 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'background-color: {{VALUE}}', | |
| 2713 | + ] | |
| 2714 | + ] | |
| 2715 | + ); | |
| 2716 | + | |
| 2717 | + $this->add_control( | |
| 2718 | + 'date_border_color', | |
| 2719 | + [ | |
| 2720 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 2721 | + 'type' => Controls_Manager::COLOR, | |
| 2722 | + 'default' => '#E8E8E8', | |
| 2723 | + 'selectors' => [ | |
| 2724 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-color: {{VALUE}}', | |
| 2725 | + ] | |
| 2726 | + ] | |
| 2727 | + ); | |
| 2728 | + | |
| 2729 | + $this->add_control( | |
| 2730 | + 'date_extra_text_color', | |
| 2731 | + [ | |
| 2732 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 2733 | + 'type' => Controls_Manager::COLOR, | |
| 2734 | + 'default' => '#ffffff', | |
| 2735 | + 'selectors' => [ | |
| 2736 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 2737 | + ], | |
| 2738 | + ] | |
| 2739 | + ); | |
| 2740 | + | |
| 2741 | + $this->add_control( | |
| 2742 | + 'date_extra_icon_color', | |
| 2743 | + [ | |
| 2744 | + 'label' => esc_html__('Extra Icon Color', 'king-addons'), | |
| 2745 | + 'type' => Controls_Manager::COLOR, | |
| 2746 | + 'default' => '#ffffff', | |
| 2747 | + 'selectors' => [ | |
| 2748 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}', | |
| 2749 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}' | |
| 2750 | + ], | |
| 2751 | + 'separator' => 'after', | |
| 2752 | + ] | |
| 2753 | + ); | |
| 2754 | + | |
| 2755 | + $this->add_group_control( | |
| 2756 | + Group_Control_Typography::get_type(), | |
| 2757 | + [ | |
| 2758 | + 'name' => 'date_typography', | |
| 2759 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-date' | |
| 2760 | + ] | |
| 2761 | + ); | |
| 2762 | + | |
| 2763 | + $this->add_control( | |
| 2764 | + 'date_border_type', | |
| 2765 | + [ | |
| 2766 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 2767 | + 'type' => Controls_Manager::SELECT, | |
| 2768 | + 'options' => [ | |
| 2769 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2770 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 2771 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 2772 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 2773 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 2774 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 2775 | + ], | |
| 2776 | + 'default' => 'none', | |
| 2777 | + 'selectors' => [ | |
| 2778 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-style: {{VALUE}};', | |
| 2779 | + ], | |
| 2780 | + 'render_type' => 'template', | |
| 2781 | + 'separator' => 'before', | |
| 2782 | + ] | |
| 2783 | + ); | |
| 2784 | + | |
| 2785 | + $this->add_control( | |
| 2786 | + 'date_border_width', | |
| 2787 | + [ | |
| 2788 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 2789 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2790 | + 'size_units' => ['px'], | |
| 2791 | + 'default' => [ | |
| 2792 | + 'top' => 1, | |
| 2793 | + 'right' => 1, | |
| 2794 | + 'bottom' => 1, | |
| 2795 | + 'left' => 1, | |
| 2796 | + ], | |
| 2797 | + 'selectors' => [ | |
| 2798 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2799 | + ], | |
| 2800 | + 'render_type' => 'template', | |
| 2801 | + 'condition' => [ | |
| 2802 | + 'date_border_type!' => 'none', | |
| 2803 | + ], | |
| 2804 | + ] | |
| 2805 | + ); | |
| 2806 | + | |
| 2807 | + $this->add_control( | |
| 2808 | + 'date_text_spacing', | |
| 2809 | + [ | |
| 2810 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 2811 | + 'type' => Controls_Manager::SLIDER, | |
| 2812 | + 'size_units' => ['px'], | |
| 2813 | + 'range' => [ | |
| 2814 | + 'px' => [ | |
| 2815 | + 'min' => 0, | |
| 2816 | + 'max' => 25, | |
| 2817 | + ], | |
| 2818 | + ], | |
| 2819 | + 'default' => [ | |
| 2820 | + 'unit' => 'px', | |
| 2821 | + 'size' => 5, | |
| 2822 | + ], | |
| 2823 | + 'selectors' => [ | |
| 2824 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 2825 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 2826 | + ], | |
| 2827 | + 'separator' => 'before', | |
| 2828 | + ] | |
| 2829 | + ); | |
| 2830 | + | |
| 2831 | + $this->add_control( | |
| 2832 | + 'date_icon_spacing', | |
| 2833 | + [ | |
| 2834 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 2835 | + 'type' => Controls_Manager::SLIDER, | |
| 2836 | + 'size_units' => ['px'], | |
| 2837 | + 'range' => [ | |
| 2838 | + 'px' => [ | |
| 2839 | + 'min' => 0, | |
| 2840 | + 'max' => 25, | |
| 2841 | + ], | |
| 2842 | + ], | |
| 2843 | + 'default' => [ | |
| 2844 | + 'unit' => 'px', | |
| 2845 | + 'size' => 5, | |
| 2846 | + ], | |
| 2847 | + 'selectors' => [ | |
| 2848 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 2849 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 2850 | + ], | |
| 2851 | + ] | |
| 2852 | + ); | |
| 2853 | + | |
| 2854 | + $this->add_responsive_control( | |
| 2855 | + 'date_padding', | |
| 2856 | + [ | |
| 2857 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 2858 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2859 | + 'size_units' => ['px', '%'], | |
| 2860 | + 'default' => [ | |
| 2861 | + 'top' => 0, | |
| 2862 | + 'right' => 0, | |
| 2863 | + 'bottom' => 0, | |
| 2864 | + 'left' => 0, | |
| 2865 | + ], | |
| 2866 | + 'selectors' => [ | |
| 2867 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2868 | + ], | |
| 2869 | + 'render_type' => 'template', | |
| 2870 | + 'separator' => 'before', | |
| 2871 | + ] | |
| 2872 | + ); | |
| 2873 | + | |
| 2874 | + $this->add_responsive_control( | |
| 2875 | + 'date_margin', | |
| 2876 | + [ | |
| 2877 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 2878 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 2879 | + 'size_units' => ['px', '%'], | |
| 2880 | + 'default' => [ | |
| 2881 | + 'top' => 2, | |
| 2882 | + 'right' => 0, | |
| 2883 | + 'bottom' => 20, | |
| 2884 | + 'left' => 22, | |
| 2885 | + ], | |
| 2886 | + 'render_type' => 'template', | |
| 2887 | + 'selectors' => [ | |
| 2888 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 2889 | + ], | |
| 2890 | + ] | |
| 2891 | + ); | |
| 2892 | + | |
| 2893 | + $this->end_controls_section(); | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + $this->start_controls_section( | |
| 2897 | + 'section_style_time', | |
| 2898 | + [ | |
| 2899 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Time', 'king-addons'), | |
| 2900 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 2901 | + 'show_label' => false, | |
| 2902 | + ] | |
| 2903 | + ); | |
| 2904 | + | |
| 2905 | + $this->add_control( | |
| 2906 | + 'time_color', | |
| 2907 | + [ | |
| 2908 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 2909 | + 'type' => Controls_Manager::COLOR, | |
| 2910 | + 'default' => '#ffffff', | |
| 2911 | + 'selectors' => [ | |
| 2912 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block' => 'color: {{VALUE}}', | |
| 2913 | + ], | |
| 2914 | + ] | |
| 2915 | + ); | |
| 2916 | + | |
| 2917 | + $this->add_control( | |
| 2918 | + 'time_bg_color', | |
| 2919 | + [ | |
| 2920 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 2921 | + 'type' => Controls_Manager::COLOR, | |
| 2922 | + 'selectors' => [ | |
| 2923 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'background-color: {{VALUE}}', | |
| 2924 | + ] | |
| 2925 | + ] | |
| 2926 | + ); | |
| 2927 | + | |
| 2928 | + $this->add_control( | |
| 2929 | + 'time_border_color', | |
| 2930 | + [ | |
| 2931 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 2932 | + 'type' => Controls_Manager::COLOR, | |
| 2933 | + 'default' => '#E8E8E8', | |
| 2934 | + 'selectors' => [ | |
| 2935 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-color: {{VALUE}}', | |
| 2936 | + ], | |
| 2937 | + ] | |
| 2938 | + ); | |
| 2939 | + | |
| 2940 | + $this->add_control( | |
| 2941 | + 'time_extra_text_color', | |
| 2942 | + [ | |
| 2943 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 2944 | + 'type' => Controls_Manager::COLOR, | |
| 2945 | + 'default' => '#ffffff', | |
| 2946 | + 'selectors' => [ | |
| 2947 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 2948 | + ], | |
| 2949 | + ] | |
| 2950 | + ); | |
| 2951 | + | |
| 2952 | + $this->add_control( | |
| 2953 | + 'time_extra_icon_color', | |
| 2954 | + [ | |
| 2955 | + 'label' => esc_html__('Extra Icon Color', 'king-addons'), | |
| 2956 | + 'type' => Controls_Manager::COLOR, | |
| 2957 | + 'default' => '#ffffff', | |
| 2958 | + 'selectors' => [ | |
| 2959 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}', | |
| 2960 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}' | |
| 2961 | + ], | |
| 2962 | + 'separator' => 'after', | |
| 2963 | + ] | |
| 2964 | + ); | |
| 2965 | + | |
| 2966 | + $this->add_group_control( | |
| 2967 | + Group_Control_Typography::get_type(), | |
| 2968 | + [ | |
| 2969 | + 'name' => 'time_typography', | |
| 2970 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-time' | |
| 2971 | + ] | |
| 2972 | + ); | |
| 2973 | + | |
| 2974 | + $this->add_control( | |
| 2975 | + 'time_border_type', | |
| 2976 | + [ | |
| 2977 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 2978 | + 'type' => Controls_Manager::SELECT, | |
| 2979 | + 'options' => [ | |
| 2980 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2981 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 2982 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 2983 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 2984 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 2985 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 2986 | + ], | |
| 2987 | + 'default' => 'none', | |
| 2988 | + 'selectors' => [ | |
| 2989 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-style: {{VALUE}};', | |
| 2990 | + ], | |
| 2991 | + 'render_type' => 'template', | |
| 2992 | + 'separator' => 'before', | |
| 2993 | + ] | |
| 2994 | + ); | |
| 2995 | + | |
| 2996 | + $this->add_control( | |
| 2997 | + 'time_border_width', | |
| 2998 | + [ | |
| 2999 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 3000 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3001 | + 'size_units' => ['px'], | |
| 3002 | + 'default' => [ | |
| 3003 | + 'top' => 1, | |
| 3004 | + 'right' => 1, | |
| 3005 | + 'bottom' => 1, | |
| 3006 | + 'left' => 1, | |
| 3007 | + ], | |
| 3008 | + 'selectors' => [ | |
| 3009 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3010 | + ], | |
| 3011 | + 'render_type' => 'template', | |
| 3012 | + 'condition' => [ | |
| 3013 | + 'time_border_type!' => 'none', | |
| 3014 | + ], | |
| 3015 | + ] | |
| 3016 | + ); | |
| 3017 | + | |
| 3018 | + $this->add_control( | |
| 3019 | + 'time_text_spacing', | |
| 3020 | + [ | |
| 3021 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 3022 | + 'type' => Controls_Manager::SLIDER, | |
| 3023 | + 'size_units' => ['px'], | |
| 3024 | + 'range' => [ | |
| 3025 | + 'px' => [ | |
| 3026 | + 'min' => 0, | |
| 3027 | + 'max' => 25, | |
| 3028 | + ], | |
| 3029 | + ], | |
| 3030 | + 'default' => [ | |
| 3031 | + 'unit' => 'px', | |
| 3032 | + 'size' => 5, | |
| 3033 | + ], | |
| 3034 | + 'selectors' => [ | |
| 3035 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 3036 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 3037 | + ], | |
| 3038 | + 'separator' => 'before', | |
| 3039 | + ] | |
| 3040 | + ); | |
| 3041 | + | |
| 3042 | + $this->add_control( | |
| 3043 | + 'time_icon_spacing', | |
| 3044 | + [ | |
| 3045 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 3046 | + 'type' => Controls_Manager::SLIDER, | |
| 3047 | + 'size_units' => ['px'], | |
| 3048 | + 'range' => [ | |
| 3049 | + 'px' => [ | |
| 3050 | + 'min' => 0, | |
| 3051 | + 'max' => 25, | |
| 3052 | + ], | |
| 3053 | + ], | |
| 3054 | + 'default' => [ | |
| 3055 | + 'unit' => 'px', | |
| 3056 | + 'size' => 5, | |
| 3057 | + ], | |
| 3058 | + 'selectors' => [ | |
| 3059 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 3060 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 3061 | + ], | |
| 3062 | + ] | |
| 3063 | + ); | |
| 3064 | + | |
| 3065 | + $this->add_responsive_control( | |
| 3066 | + 'time_padding', | |
| 3067 | + [ | |
| 3068 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 3069 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3070 | + 'size_units' => ['px', '%'], | |
| 3071 | + 'default' => [ | |
| 3072 | + 'top' => 0, | |
| 3073 | + 'right' => 0, | |
| 3074 | + 'bottom' => 0, | |
| 3075 | + 'left' => 0, | |
| 3076 | + ], | |
| 3077 | + 'selectors' => [ | |
| 3078 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3079 | + ], | |
| 3080 | + 'render_type' => 'template', | |
| 3081 | + 'separator' => 'before', | |
| 3082 | + ] | |
| 3083 | + ); | |
| 3084 | + | |
| 3085 | + $this->add_responsive_control( | |
| 3086 | + 'time_margin', | |
| 3087 | + [ | |
| 3088 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 3089 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3090 | + 'size_units' => ['px', '%'], | |
| 3091 | + 'default' => [ | |
| 3092 | + 'top' => 0, | |
| 3093 | + 'right' => 0, | |
| 3094 | + 'bottom' => 0, | |
| 3095 | + 'left' => 0, | |
| 3096 | + ], | |
| 3097 | + 'selectors' => [ | |
| 3098 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3099 | + ], | |
| 3100 | + 'render_type' => 'template', | |
| 3101 | + ] | |
| 3102 | + ); | |
| 3103 | + | |
| 3104 | + $this->end_controls_section(); | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + $this->start_controls_section( | |
| 3108 | + 'section_style_author', | |
| 3109 | + [ | |
| 3110 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Author', 'king-addons'), | |
| 3111 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 3112 | + 'show_label' => false, | |
| 3113 | + ] | |
| 3114 | + ); | |
| 3115 | + | |
| 3116 | + $this->start_controls_tabs('tabs_grid_author_style'); | |
| 3117 | + | |
| 3118 | + $this->start_controls_tab( | |
| 3119 | + 'tab_grid_author_normal', | |
| 3120 | + [ | |
| 3121 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 3122 | + ] | |
| 3123 | + ); | |
| 3124 | + | |
| 3125 | + $this->add_control( | |
| 3126 | + 'author_color', | |
| 3127 | + [ | |
| 3128 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 3129 | + 'type' => Controls_Manager::COLOR, | |
| 3130 | + 'default' => '#ffffff', | |
| 3131 | + 'selectors' => [ | |
| 3132 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'color: {{VALUE}}', | |
| 3133 | + ], | |
| 3134 | + ] | |
| 3135 | + ); | |
| 3136 | + | |
| 3137 | + $this->add_control( | |
| 3138 | + 'author_bg_color', | |
| 3139 | + [ | |
| 3140 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 3141 | + 'type' => Controls_Manager::COLOR, | |
| 3142 | + 'selectors' => [ | |
| 3143 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'background-color: {{VALUE}}', | |
| 3144 | + ] | |
| 3145 | + ] | |
| 3146 | + ); | |
| 3147 | + | |
| 3148 | + $this->add_control( | |
| 3149 | + 'author_border_color', | |
| 3150 | + [ | |
| 3151 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 3152 | + 'type' => Controls_Manager::COLOR, | |
| 3153 | + 'default' => '#E8E8E8', | |
| 3154 | + 'selectors' => [ | |
| 3155 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-color: {{VALUE}}', | |
| 3156 | + ], | |
| 3157 | + ] | |
| 3158 | + ); | |
| 3159 | + | |
| 3160 | + $this->add_control( | |
| 3161 | + 'author_extra_text_color', | |
| 3162 | + [ | |
| 3163 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 3164 | + 'type' => Controls_Manager::COLOR, | |
| 3165 | + 'default' => '#ffffff', | |
| 3166 | + 'selectors' => [ | |
| 3167 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 3168 | + ], | |
| 3169 | + 'separator' => 'after', | |
| 3170 | + ] | |
| 3171 | + ); | |
| 3172 | + | |
| 3173 | + $this->end_controls_tab(); | |
| 3174 | + | |
| 3175 | + $this->start_controls_tab( | |
| 3176 | + 'tab_grid_author_hover', | |
| 3177 | + [ | |
| 3178 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 3179 | + ] | |
| 3180 | + ); | |
| 3181 | + | |
| 3182 | + $this->add_control( | |
| 3183 | + 'author_color_hr', | |
| 3184 | + [ | |
| 3185 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 3186 | + 'type' => Controls_Manager::COLOR, | |
| 3187 | + 'default' => '#5B03FF', | |
| 3188 | + 'selectors' => [ | |
| 3189 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'color: {{VALUE}}', | |
| 3190 | + ], | |
| 3191 | + ] | |
| 3192 | + ); | |
| 3193 | + | |
| 3194 | + $this->add_control( | |
| 3195 | + 'author_bg_color_hr', | |
| 3196 | + [ | |
| 3197 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 3198 | + 'type' => Controls_Manager::COLOR, | |
| 3199 | + 'selectors' => [ | |
| 3200 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 3201 | + ] | |
| 3202 | + ] | |
| 3203 | + ); | |
| 3204 | + | |
| 3205 | + $this->add_control( | |
| 3206 | + 'author_border_color_hr', | |
| 3207 | + [ | |
| 3208 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 3209 | + 'type' => Controls_Manager::COLOR, | |
| 3210 | + 'default' => '#E8E8E8', | |
| 3211 | + 'selectors' => [ | |
| 3212 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 3213 | + ], | |
| 3214 | + 'separator' => 'after', | |
| 3215 | + ] | |
| 3216 | + ); | |
| 3217 | + | |
| 3218 | + $this->end_controls_tab(); | |
| 3219 | + | |
| 3220 | + $this->end_controls_tabs(); | |
| 3221 | + | |
| 3222 | + $this->add_control( | |
| 3223 | + 'author_transition_duration', | |
| 3224 | + [ | |
| 3225 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 3226 | + 'type' => Controls_Manager::NUMBER, | |
| 3227 | + 'default' => 0.1, | |
| 3228 | + 'min' => 0, | |
| 3229 | + 'max' => 5, | |
| 3230 | + 'step' => 0.1, | |
| 3231 | + 'selectors' => [ | |
| 3232 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 3233 | + ], | |
| 3234 | + 'separator' => 'after', | |
| 3235 | + ] | |
| 3236 | + ); | |
| 3237 | + | |
| 3238 | + $this->add_group_control( | |
| 3239 | + Group_Control_Typography::get_type(), | |
| 3240 | + [ | |
| 3241 | + 'name' => 'author_typography', | |
| 3242 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-author' | |
| 3243 | + ] | |
| 3244 | + ); | |
| 3245 | + | |
| 3246 | + $this->add_control( | |
| 3247 | + 'author_border_type', | |
| 3248 | + [ | |
| 3249 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 3250 | + 'type' => Controls_Manager::SELECT, | |
| 3251 | + 'options' => [ | |
| 3252 | + 'none' => esc_html__('None', 'king-addons'), | |
| 3253 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 3254 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 3255 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 3256 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 3257 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 3258 | + ], | |
| 3259 | + 'default' => 'none', | |
| 3260 | + 'selectors' => [ | |
| 3261 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-style: {{VALUE}};', | |
| 3262 | + ], | |
| 3263 | + 'render_type' => 'template', | |
| 3264 | + 'separator' => 'before', | |
| 3265 | + ] | |
| 3266 | + ); | |
| 3267 | + | |
| 3268 | + $this->add_control( | |
| 3269 | + 'author_border_width', | |
| 3270 | + [ | |
| 3271 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 3272 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3273 | + 'size_units' => ['px'], | |
| 3274 | + 'default' => [ | |
| 3275 | + 'top' => 1, | |
| 3276 | + 'right' => 1, | |
| 3277 | + 'bottom' => 1, | |
| 3278 | + 'left' => 1, | |
| 3279 | + ], | |
| 3280 | + 'selectors' => [ | |
| 3281 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3282 | + ], | |
| 3283 | + 'render_type' => 'template', | |
| 3284 | + 'condition' => [ | |
| 3285 | + 'author_border_type!' => 'none', | |
| 3286 | + ], | |
| 3287 | + ] | |
| 3288 | + ); | |
| 3289 | + | |
| 3290 | + $this->add_control( | |
| 3291 | + 'author_border_radius', | |
| 3292 | + [ | |
| 3293 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 3294 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3295 | + 'size_units' => ['px'], | |
| 3296 | + 'default' => [ | |
| 3297 | + 'top' => 0, | |
| 3298 | + 'right' => 0, | |
| 3299 | + 'bottom' => 0, | |
| 3300 | + 'left' => 0, | |
| 3301 | + ], | |
| 3302 | + 'selectors' => [ | |
| 3303 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3304 | + ] | |
| 3305 | + ] | |
| 3306 | + ); | |
| 3307 | + | |
| 3308 | + $this->add_control( | |
| 3309 | + 'author_text_spacing', | |
| 3310 | + [ | |
| 3311 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 3312 | + 'type' => Controls_Manager::SLIDER, | |
| 3313 | + 'size_units' => ['px'], | |
| 3314 | + 'range' => [ | |
| 3315 | + 'px' => [ | |
| 3316 | + 'min' => 0, | |
| 3317 | + 'max' => 25, | |
| 3318 | + ], | |
| 3319 | + ], | |
| 3320 | + 'default' => [ | |
| 3321 | + 'unit' => 'px', | |
| 3322 | + 'size' => 5, | |
| 3323 | + ], | |
| 3324 | + 'selectors' => [ | |
| 3325 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 3326 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 3327 | + ], | |
| 3328 | + 'separator' => 'before', | |
| 3329 | + ] | |
| 3330 | + ); | |
| 3331 | + | |
| 3332 | + $this->add_control( | |
| 3333 | + 'author_icon_spacing', | |
| 3334 | + [ | |
| 3335 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 3336 | + 'type' => Controls_Manager::SLIDER, | |
| 3337 | + 'size_units' => ['px'], | |
| 3338 | + 'range' => [ | |
| 3339 | + 'px' => [ | |
| 3340 | + 'min' => 0, | |
| 3341 | + 'max' => 25, | |
| 3342 | + ], | |
| 3343 | + ], | |
| 3344 | + 'default' => [ | |
| 3345 | + 'unit' => 'px', | |
| 3346 | + 'size' => 5, | |
| 3347 | + ], | |
| 3348 | + 'selectors' => [ | |
| 3349 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 3350 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 3351 | + ], | |
| 3352 | + ] | |
| 3353 | + ); | |
| 3354 | + | |
| 3355 | + $this->add_control( | |
| 3356 | + 'author_avatar_spacing', | |
| 3357 | + [ | |
| 3358 | + 'label' => esc_html__('Avatar Spacing', 'king-addons'), | |
| 3359 | + 'type' => Controls_Manager::SLIDER, | |
| 3360 | + 'size_units' => ['px'], | |
| 3361 | + 'range' => [ | |
| 3362 | + 'px' => [ | |
| 3363 | + 'min' => 0, | |
| 3364 | + 'max' => 25, | |
| 3365 | + ], | |
| 3366 | + ], | |
| 3367 | + 'default' => [ | |
| 3368 | + 'unit' => 'px', | |
| 3369 | + 'size' => 10, | |
| 3370 | + ], | |
| 3371 | + 'selectors' => [ | |
| 3372 | + '{{WRAPPER}} .king-addons-grid-item-author img' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 3373 | + ], | |
| 3374 | + ] | |
| 3375 | + ); | |
| 3376 | + | |
| 3377 | + $this->add_responsive_control( | |
| 3378 | + 'author_padding', | |
| 3379 | + [ | |
| 3380 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 3381 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3382 | + 'size_units' => ['px', '%'], | |
| 3383 | + 'default' => [ | |
| 3384 | + 'top' => 0, | |
| 3385 | + 'right' => 0, | |
| 3386 | + 'bottom' => 0, | |
| 3387 | + 'left' => 0, | |
| 3388 | + ], | |
| 3389 | + 'selectors' => [ | |
| 3390 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3391 | + ], | |
| 3392 | + 'render_type' => 'template', | |
| 3393 | + 'separator' => 'before', | |
| 3394 | + ] | |
| 3395 | + ); | |
| 3396 | + | |
| 3397 | + $this->add_responsive_control( | |
| 3398 | + 'author_margin', | |
| 3399 | + [ | |
| 3400 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 3401 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3402 | + 'size_units' => ['px', '%'], | |
| 3403 | + 'default' => [ | |
| 3404 | + 'top' => 1, | |
| 3405 | + 'right' => 10, | |
| 3406 | + 'bottom' => 0, | |
| 3407 | + 'left' => 22, | |
| 3408 | + ], | |
| 3409 | + 'render_type' => 'template', | |
| 3410 | + 'selectors' => [ | |
| 3411 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3412 | + ], | |
| 3413 | + ] | |
| 3414 | + ); | |
| 3415 | + | |
| 3416 | + $this->end_controls_section(); | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + $this->start_controls_section( | |
| 3420 | + 'section_style_comments', | |
| 3421 | + [ | |
| 3422 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Comments', 'king-addons'), | |
| 3423 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 3424 | + 'show_label' => false, | |
| 3425 | + ] | |
| 3426 | + ); | |
| 3427 | + | |
| 3428 | + $this->start_controls_tabs('tabs_grid_comments_style'); | |
| 3429 | + | |
| 3430 | + $this->start_controls_tab( | |
| 3431 | + 'tab_grid_comments_normal', | |
| 3432 | + [ | |
| 3433 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 3434 | + ] | |
| 3435 | + ); | |
| 3436 | + | |
| 3437 | + $this->add_control( | |
| 3438 | + 'comments_color', | |
| 3439 | + [ | |
| 3440 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 3441 | + 'type' => Controls_Manager::COLOR, | |
| 3442 | + 'default' => '#ffffff', | |
| 3443 | + 'selectors' => [ | |
| 3444 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'color: {{VALUE}}', | |
| 3445 | + ], | |
| 3446 | + ] | |
| 3447 | + ); | |
| 3448 | + | |
| 3449 | + $this->add_control( | |
| 3450 | + 'comments_bg_color', | |
| 3451 | + [ | |
| 3452 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 3453 | + 'type' => Controls_Manager::COLOR, | |
| 3454 | + 'selectors' => [ | |
| 3455 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'background-color: {{VALUE}}', | |
| 3456 | + ] | |
| 3457 | + ] | |
| 3458 | + ); | |
| 3459 | + | |
| 3460 | + $this->add_control( | |
| 3461 | + 'comments_border_color', | |
| 3462 | + [ | |
| 3463 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 3464 | + 'type' => Controls_Manager::COLOR, | |
| 3465 | + 'default' => '#E8E8E8', | |
| 3466 | + 'selectors' => [ | |
| 3467 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-color: {{VALUE}}', | |
| 3468 | + ], | |
| 3469 | + ] | |
| 3470 | + ); | |
| 3471 | + | |
| 3472 | + $this->add_control( | |
| 3473 | + 'comments_extra_text_color', | |
| 3474 | + [ | |
| 3475 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 3476 | + 'type' => Controls_Manager::COLOR, | |
| 3477 | + 'default' => '#ffffff', | |
| 3478 | + 'selectors' => [ | |
| 3479 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 3480 | + ], | |
| 3481 | + 'separator' => 'after', | |
| 3482 | + ] | |
| 3483 | + ); | |
| 3484 | + | |
| 3485 | + $this->end_controls_tab(); | |
| 3486 | + | |
| 3487 | + $this->start_controls_tab( | |
| 3488 | + 'tab_grid_comments_hover', | |
| 3489 | + [ | |
| 3490 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 3491 | + ] | |
| 3492 | + ); | |
| 3493 | + | |
| 3494 | + $this->add_control( | |
| 3495 | + 'comments_color_hr', | |
| 3496 | + [ | |
| 3497 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 3498 | + 'type' => Controls_Manager::COLOR, | |
| 3499 | + 'default' => '#5B03FF', | |
| 3500 | + 'selectors' => [ | |
| 3501 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'color: {{VALUE}}', | |
| 3502 | + ], | |
| 3503 | + ] | |
| 3504 | + ); | |
| 3505 | + | |
| 3506 | + $this->add_control( | |
| 3507 | + 'comments_bg_color_hr', | |
| 3508 | + [ | |
| 3509 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 3510 | + 'type' => Controls_Manager::COLOR, | |
| 3511 | + 'selectors' => [ | |
| 3512 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 3513 | + ] | |
| 3514 | + ] | |
| 3515 | + ); | |
| 3516 | + | |
| 3517 | + $this->add_control( | |
| 3518 | + 'comments_border_color_hr', | |
| 3519 | + [ | |
| 3520 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 3521 | + 'type' => Controls_Manager::COLOR, | |
| 3522 | + 'default' => '#E8E8E8', | |
| 3523 | + 'selectors' => [ | |
| 3524 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 3525 | + ], | |
| 3526 | + 'separator' => 'after', | |
| 3527 | + ] | |
| 3528 | + ); | |
| 3529 | + | |
| 3530 | + $this->end_controls_tab(); | |
| 3531 | + | |
| 3532 | + $this->end_controls_tabs(); | |
| 3533 | + | |
| 3534 | + $this->add_control( | |
| 3535 | + 'comments_transition_duration', | |
| 3536 | + [ | |
| 3537 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 3538 | + 'type' => Controls_Manager::NUMBER, | |
| 3539 | + 'default' => 0.1, | |
| 3540 | + 'min' => 0, | |
| 3541 | + 'max' => 5, | |
| 3542 | + 'step' => 0.1, | |
| 3543 | + 'selectors' => [ | |
| 3544 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 3545 | + ], | |
| 3546 | + 'separator' => 'after', | |
| 3547 | + ] | |
| 3548 | + ); | |
| 3549 | + | |
| 3550 | + $this->add_group_control( | |
| 3551 | + Group_Control_Typography::get_type(), | |
| 3552 | + [ | |
| 3553 | + 'name' => 'comments_typography', | |
| 3554 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-comments' | |
| 3555 | + ] | |
| 3556 | + ); | |
| 3557 | + | |
| 3558 | + $this->add_control( | |
| 3559 | + 'comments_border_type', | |
| 3560 | + [ | |
| 3561 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 3562 | + 'type' => Controls_Manager::SELECT, | |
| 3563 | + 'options' => [ | |
| 3564 | + 'none' => esc_html__('None', 'king-addons'), | |
| 3565 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 3566 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 3567 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 3568 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 3569 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 3570 | + ], | |
| 3571 | + 'default' => 'none', | |
| 3572 | + 'selectors' => [ | |
| 3573 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-style: {{VALUE}};', | |
| 3574 | + ], | |
| 3575 | + 'render_type' => 'template', | |
| 3576 | + 'separator' => 'before', | |
| 3577 | + ] | |
| 3578 | + ); | |
| 3579 | + | |
| 3580 | + $this->add_control( | |
| 3581 | + 'comments_border_width', | |
| 3582 | + [ | |
| 3583 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 3584 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3585 | + 'size_units' => ['px'], | |
| 3586 | + 'default' => [ | |
| 3587 | + 'top' => 1, | |
| 3588 | + 'right' => 1, | |
| 3589 | + 'bottom' => 1, | |
| 3590 | + 'left' => 1, | |
| 3591 | + ], | |
| 3592 | + 'selectors' => [ | |
| 3593 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3594 | + ], | |
| 3595 | + 'render_type' => 'template', | |
| 3596 | + 'condition' => [ | |
| 3597 | + 'comments_border_type!' => 'none', | |
| 3598 | + ], | |
| 3599 | + ] | |
| 3600 | + ); | |
| 3601 | + | |
| 3602 | + $this->add_control( | |
| 3603 | + 'comments_text_spacing', | |
| 3604 | + [ | |
| 3605 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 3606 | + 'type' => Controls_Manager::SLIDER, | |
| 3607 | + 'size_units' => ['px'], | |
| 3608 | + 'range' => [ | |
| 3609 | + 'px' => [ | |
| 3610 | + 'min' => 0, | |
| 3611 | + 'max' => 25, | |
| 3612 | + ], | |
| 3613 | + ], | |
| 3614 | + 'default' => [ | |
| 3615 | + 'unit' => 'px', | |
| 3616 | + 'size' => 5, | |
| 3617 | + ], | |
| 3618 | + 'selectors' => [ | |
| 3619 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 3620 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 3621 | + ], | |
| 3622 | + 'separator' => 'before' | |
| 3623 | + ] | |
| 3624 | + ); | |
| 3625 | + | |
| 3626 | + $this->add_control( | |
| 3627 | + 'comments_icon_spacing', | |
| 3628 | + [ | |
| 3629 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 3630 | + 'type' => Controls_Manager::SLIDER, | |
| 3631 | + 'size_units' => ['px'], | |
| 3632 | + 'range' => [ | |
| 3633 | + 'px' => [ | |
| 3634 | + 'min' => 0, | |
| 3635 | + 'max' => 25, | |
| 3636 | + ], | |
| 3637 | + ], | |
| 3638 | + 'default' => [ | |
| 3639 | + 'unit' => 'px', | |
| 3640 | + 'size' => 5, | |
| 3641 | + ], | |
| 3642 | + 'selectors' => [ | |
| 3643 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 3644 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 3645 | + ], | |
| 3646 | + ] | |
| 3647 | + ); | |
| 3648 | + | |
| 3649 | + $this->add_responsive_control( | |
| 3650 | + 'comments_padding', | |
| 3651 | + [ | |
| 3652 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 3653 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3654 | + 'size_units' => ['px', '%'], | |
| 3655 | + 'default' => [ | |
| 3656 | + 'top' => 0, | |
| 3657 | + 'right' => 0, | |
| 3658 | + 'bottom' => 0, | |
| 3659 | + 'left' => 0, | |
| 3660 | + ], | |
| 3661 | + 'selectors' => [ | |
| 3662 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3663 | + ], | |
| 3664 | + 'render_type' => 'template', | |
| 3665 | + 'separator' => 'before', | |
| 3666 | + ] | |
| 3667 | + ); | |
| 3668 | + | |
| 3669 | + $this->add_responsive_control( | |
| 3670 | + 'comments_margin', | |
| 3671 | + [ | |
| 3672 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 3673 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3674 | + 'size_units' => ['px', '%'], | |
| 3675 | + 'default' => [ | |
| 3676 | + 'top' => 0, | |
| 3677 | + 'right' => 0, | |
| 3678 | + 'bottom' => 0, | |
| 3679 | + 'left' => 0, | |
| 3680 | + ], | |
| 3681 | + 'selectors' => [ | |
| 3682 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3683 | + ], | |
| 3684 | + 'render_type' => 'template', | |
| 3685 | + ] | |
| 3686 | + ); | |
| 3687 | + | |
| 3688 | + $this->add_control( | |
| 3689 | + 'comments_radius', | |
| 3690 | + [ | |
| 3691 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 3692 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3693 | + 'size_units' => ['px', '%'], | |
| 3694 | + 'default' => [ | |
| 3695 | + 'top' => 2, | |
| 3696 | + 'right' => 2, | |
| 3697 | + 'bottom' => 2, | |
| 3698 | + 'left' => 2, | |
| 3699 | + ], | |
| 3700 | + 'selectors' => [ | |
| 3701 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3702 | + ], | |
| 3703 | + 'separator' => 'before', | |
| 3704 | + ] | |
| 3705 | + ); | |
| 3706 | + | |
| 3707 | + $this->end_controls_section(); | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + $this->start_controls_section( | |
| 3711 | + 'section_style_read_more', | |
| 3712 | + [ | |
| 3713 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Read More', 'king-addons'), | |
| 3714 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 3715 | + 'show_label' => false, | |
| 3716 | + ] | |
| 3717 | + ); | |
| 3718 | + | |
| 3719 | + $this->start_controls_tabs('tabs_grid_read_more_style'); | |
| 3720 | + | |
| 3721 | + $this->start_controls_tab( | |
| 3722 | + 'tab_grid_read_more_normal', | |
| 3723 | + [ | |
| 3724 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 3725 | + ] | |
| 3726 | + ); | |
| 3727 | + | |
| 3728 | + $this->add_group_control( | |
| 3729 | + Group_Control_Background::get_type(), | |
| 3730 | + [ | |
| 3731 | + 'name' => 'read_more_bg_color', | |
| 3732 | + 'label' => esc_html__('Background', 'king-addons'), | |
| 3733 | + 'types' => ['classic', 'gradient'], | |
| 3734 | + 'fields_options' => [ | |
| 3735 | + 'color' => [ | |
| 3736 | + 'default' => '#434900', | |
| 3737 | + ], | |
| 3738 | + ], | |
| 3739 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' | |
| 3740 | + ] | |
| 3741 | + ); | |
| 3742 | + | |
| 3743 | + $this->add_control( | |
| 3744 | + 'read_more_color', | |
| 3745 | + [ | |
| 3746 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 3747 | + 'type' => Controls_Manager::COLOR, | |
| 3748 | + 'default' => '#ffffff', | |
| 3749 | + 'selectors' => [ | |
| 3750 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'color: {{VALUE}}', | |
| 3751 | + ], | |
| 3752 | + ] | |
| 3753 | + ); | |
| 3754 | + | |
| 3755 | + $this->add_control( | |
| 3756 | + 'read_more_border_color', | |
| 3757 | + [ | |
| 3758 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 3759 | + 'type' => Controls_Manager::COLOR, | |
| 3760 | + 'default' => '#E8E8E8', | |
| 3761 | + 'selectors' => [ | |
| 3762 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-color: {{VALUE}}', | |
| 3763 | + ], | |
| 3764 | + ] | |
| 3765 | + ); | |
| 3766 | + | |
| 3767 | + $this->add_group_control( | |
| 3768 | + Group_Control_Box_Shadow::get_type(), | |
| 3769 | + [ | |
| 3770 | + 'name' => 'read_more_box_shadow', | |
| 3771 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a', | |
| 3772 | + ] | |
| 3773 | + ); | |
| 3774 | + | |
| 3775 | + $this->end_controls_tab(); | |
| 3776 | + | |
| 3777 | + $this->start_controls_tab( | |
| 3778 | + 'tab_grid_read_more_hover', | |
| 3779 | + [ | |
| 3780 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 3781 | + ] | |
| 3782 | + ); | |
| 3783 | + | |
| 3784 | + $this->add_group_control( | |
| 3785 | + Group_Control_Background::get_type(), | |
| 3786 | + [ | |
| 3787 | + 'name' => 'read_more_bg_color_hr', | |
| 3788 | + 'label' => esc_html__('Background', 'king-addons'), | |
| 3789 | + 'types' => ['classic', 'gradient'], | |
| 3790 | + 'fields_options' => [ | |
| 3791 | + 'color' => [ | |
| 3792 | + 'default' => '#434900', | |
| 3793 | + ], | |
| 3794 | + ], | |
| 3795 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a.king-addons-button-none:hover, {{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:before, {{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:after' | |
| 3796 | + ] | |
| 3797 | + ); | |
| 3798 | + | |
| 3799 | + $this->add_control( | |
| 3800 | + 'read_more_color_hr', | |
| 3801 | + [ | |
| 3802 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 3803 | + 'type' => Controls_Manager::COLOR, | |
| 3804 | + 'default' => '#5B03FF', | |
| 3805 | + 'selectors' => [ | |
| 3806 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:hover' => 'color: {{VALUE}}', | |
| 3807 | + ], | |
| 3808 | + ] | |
| 3809 | + ); | |
| 3810 | + | |
| 3811 | + $this->add_control( | |
| 3812 | + 'read_more_border_color_hr', | |
| 3813 | + [ | |
| 3814 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 3815 | + 'type' => Controls_Manager::COLOR, | |
| 3816 | + 'default' => '#E8E8E8', | |
| 3817 | + 'selectors' => [ | |
| 3818 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 3819 | + ] | |
| 3820 | + ] | |
| 3821 | + ); | |
| 3822 | + | |
| 3823 | + $this->add_group_control( | |
| 3824 | + Group_Control_Box_Shadow::get_type(), | |
| 3825 | + [ | |
| 3826 | + 'name' => 'read_more_box_shadow_hr', | |
| 3827 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block :hover a', | |
| 3828 | + ] | |
| 3829 | + ); | |
| 3830 | + | |
| 3831 | + $this->end_controls_tab(); | |
| 3832 | + | |
| 3833 | + $this->end_controls_tabs(); | |
| 3834 | + | |
| 3835 | + $this->add_control( | |
| 3836 | + 'read_more_divider', | |
| 3837 | + [ | |
| 3838 | + 'type' => Controls_Manager::DIVIDER, | |
| 3839 | + 'style' => 'thick', | |
| 3840 | + ] | |
| 3841 | + ); | |
| 3842 | + | |
| 3843 | + $this->add_control_read_more_animation(); | |
| 3844 | + | |
| 3845 | + $this->add_control( | |
| 3846 | + 'read_more_transition_duration', | |
| 3847 | + [ | |
| 3848 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 3849 | + 'type' => Controls_Manager::NUMBER, | |
| 3850 | + 'default' => 0.1, | |
| 3851 | + 'min' => 0, | |
| 3852 | + 'max' => 5, | |
| 3853 | + 'step' => 0.1, | |
| 3854 | + 'selectors' => [ | |
| 3855 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 3856 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:before' => 'transition-duration: {{VALUE}}s', | |
| 3857 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:after' => 'transition-duration: {{VALUE}}s', | |
| 3858 | + ], | |
| 3859 | + ] | |
| 3860 | + ); | |
| 3861 | + | |
| 3862 | + $this->add_control_read_more_animation_height(); | |
| 3863 | + | |
| 3864 | + $this->add_control( | |
| 3865 | + 'read_more_typo_divider', | |
| 3866 | + [ | |
| 3867 | + 'type' => Controls_Manager::DIVIDER, | |
| 3868 | + 'style' => 'thick', | |
| 3869 | + ] | |
| 3870 | + ); | |
| 3871 | + | |
| 3872 | + $this->add_group_control( | |
| 3873 | + Group_Control_Typography::get_type(), | |
| 3874 | + [ | |
| 3875 | + 'name' => 'read_more_typography', | |
| 3876 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more a' | |
| 3877 | + ] | |
| 3878 | + ); | |
| 3879 | + | |
| 3880 | + $this->add_control( | |
| 3881 | + 'read_more_border_type', | |
| 3882 | + [ | |
| 3883 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 3884 | + 'type' => Controls_Manager::SELECT, | |
| 3885 | + 'options' => [ | |
| 3886 | + 'none' => esc_html__('None', 'king-addons'), | |
| 3887 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 3888 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 3889 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 3890 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 3891 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 3892 | + ], | |
| 3893 | + 'default' => 'none', | |
| 3894 | + 'selectors' => [ | |
| 3895 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-style: {{VALUE}};', | |
| 3896 | + ], | |
| 3897 | + 'render_type' => 'template', | |
| 3898 | + 'separator' => 'before', | |
| 3899 | + ] | |
| 3900 | + ); | |
| 3901 | + | |
| 3902 | + $this->add_control( | |
| 3903 | + 'read_more_border_width', | |
| 3904 | + [ | |
| 3905 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 3906 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3907 | + 'size_units' => ['px'], | |
| 3908 | + 'default' => [ | |
| 3909 | + 'top' => 1, | |
| 3910 | + 'right' => 1, | |
| 3911 | + 'bottom' => 1, | |
| 3912 | + 'left' => 1, | |
| 3913 | + ], | |
| 3914 | + 'selectors' => [ | |
| 3915 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3916 | + ], | |
| 3917 | + 'render_type' => 'template', | |
| 3918 | + 'condition' => [ | |
| 3919 | + 'read_more_border_type!' => 'none', | |
| 3920 | + ], | |
| 3921 | + ] | |
| 3922 | + ); | |
| 3923 | + | |
| 3924 | + $this->add_control( | |
| 3925 | + 'read_more_icon_spacing', | |
| 3926 | + [ | |
| 3927 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 3928 | + 'type' => Controls_Manager::SLIDER, | |
| 3929 | + 'size_units' => ['px'], | |
| 3930 | + 'range' => [ | |
| 3931 | + 'px' => [ | |
| 3932 | + 'min' => 0, | |
| 3933 | + 'max' => 25, | |
| 3934 | + ], | |
| 3935 | + ], | |
| 3936 | + 'default' => [ | |
| 3937 | + 'unit' => 'px', | |
| 3938 | + 'size' => 5, | |
| 3939 | + ], | |
| 3940 | + 'selectors' => [ | |
| 3941 | + '{{WRAPPER}} .king-addons-grid-item-read-more .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 3942 | + '{{WRAPPER}} .king-addons-grid-item-read-more .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 3943 | + ], | |
| 3944 | + 'separator' => 'before' | |
| 3945 | + ] | |
| 3946 | + ); | |
| 3947 | + | |
| 3948 | + $this->add_responsive_control( | |
| 3949 | + 'read_more_padding', | |
| 3950 | + [ | |
| 3951 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 3952 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3953 | + 'size_units' => ['px', '%'], | |
| 3954 | + 'default' => [ | |
| 3955 | + 'top' => 0, | |
| 3956 | + 'right' => 0, | |
| 3957 | + 'bottom' => 0, | |
| 3958 | + 'left' => 0, | |
| 3959 | + ], | |
| 3960 | + 'selectors' => [ | |
| 3961 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3962 | + ], | |
| 3963 | + 'render_type' => 'template', | |
| 3964 | + 'separator' => 'before', | |
| 3965 | + ] | |
| 3966 | + ); | |
| 3967 | + | |
| 3968 | + $this->add_responsive_control( | |
| 3969 | + 'read_more_margin', | |
| 3970 | + [ | |
| 3971 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 3972 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3973 | + 'size_units' => ['px', '%'], | |
| 3974 | + 'default' => [ | |
| 3975 | + 'top' => 0, | |
| 3976 | + 'right' => 0, | |
| 3977 | + 'bottom' => 0, | |
| 3978 | + 'left' => 0, | |
| 3979 | + ], | |
| 3980 | + 'selectors' => [ | |
| 3981 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3982 | + ], | |
| 3983 | + 'render_type' => 'template', | |
| 3984 | + ] | |
| 3985 | + ); | |
| 3986 | + | |
| 3987 | + $this->add_control( | |
| 3988 | + 'read_more_radius', | |
| 3989 | + [ | |
| 3990 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 3991 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3992 | + 'size_units' => ['px', '%'], | |
| 3993 | + 'default' => [ | |
| 3994 | + 'top' => 2, | |
| 3995 | + 'right' => 2, | |
| 3996 | + 'bottom' => 2, | |
| 3997 | + 'left' => 2, | |
| 3998 | + ], | |
| 3999 | + 'selectors' => [ | |
| 4000 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4001 | + ], | |
| 4002 | + 'separator' => 'before', | |
| 4003 | + ] | |
| 4004 | + ); | |
| 4005 | + | |
| 4006 | + $this->end_controls_section(); | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + $this->add_section_style_likes(); | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + $this->add_section_style_sharing(); | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + $this->start_controls_section( | |
| 4016 | + 'section_style_separator1', | |
| 4017 | + [ | |
| 4018 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 1', 'king-addons'), | |
| 4019 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4020 | + 'show_label' => false, | |
| 4021 | + ] | |
| 4022 | + ); | |
| 4023 | + | |
| 4024 | + $this->add_control( | |
| 4025 | + 'separator1_color', | |
| 4026 | + [ | |
| 4027 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4028 | + 'type' => Controls_Manager::COLOR, | |
| 4029 | + 'default' => '#ffffff', | |
| 4030 | + 'selectors' => [ | |
| 4031 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-color: {{VALUE}}', | |
| 4032 | + ], | |
| 4033 | + ] | |
| 4034 | + ); | |
| 4035 | + | |
| 4036 | + $this->add_control( | |
| 4037 | + 'separator1_width', | |
| 4038 | + [ | |
| 4039 | + 'label' => esc_html__('Width', 'king-addons'), | |
| 4040 | + 'type' => Controls_Manager::SLIDER, | |
| 4041 | + 'size_units' => ['px', '%'], | |
| 4042 | + 'range' => [ | |
| 4043 | + 'px' => [ | |
| 4044 | + 'min' => 0, | |
| 4045 | + 'max' => 300, | |
| 4046 | + ], | |
| 4047 | + '%' => [ | |
| 4048 | + 'min' => 0, | |
| 4049 | + 'max' => 100, | |
| 4050 | + ], | |
| 4051 | + ], | |
| 4052 | + 'default' => [ | |
| 4053 | + 'unit' => 'px', | |
| 4054 | + 'size' => 10, | |
| 4055 | + ], | |
| 4056 | + 'selectors' => [ | |
| 4057 | + '{{WRAPPER}} .king-addons-grid-sep-style-1:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};', | |
| 4058 | + '{{WRAPPER}} .king-addons-grid-sep-style-1.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};', | |
| 4059 | + ], | |
| 4060 | + 'render_type' => 'template', | |
| 4061 | + 'separator' => 'before', | |
| 4062 | + ] | |
| 4063 | + ); | |
| 4064 | + | |
| 4065 | + $this->add_control( | |
| 4066 | + 'separator1_height', | |
| 4067 | + [ | |
| 4068 | + 'label' => esc_html__('Height', 'king-addons'), | |
| 4069 | + 'type' => Controls_Manager::SLIDER, | |
| 4070 | + 'size_units' => ['px'], | |
| 4071 | + 'range' => [ | |
| 4072 | + 'px' => [ | |
| 4073 | + 'min' => 1, | |
| 4074 | + 'max' => 100, | |
| 4075 | + ], | |
| 4076 | + ], | |
| 4077 | + 'default' => [ | |
| 4078 | + 'unit' => 'px', | |
| 4079 | + 'size' => 1, | |
| 4080 | + ], | |
| 4081 | + 'render_type' => 'template', | |
| 4082 | + 'selectors' => [ | |
| 4083 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};', | |
| 4084 | + ], | |
| 4085 | + ] | |
| 4086 | + ); | |
| 4087 | + | |
| 4088 | + $this->add_control( | |
| 4089 | + 'separator1_border_type', | |
| 4090 | + [ | |
| 4091 | + 'label' => esc_html__('Type', 'king-addons'), | |
| 4092 | + 'type' => Controls_Manager::SELECT, | |
| 4093 | + 'options' => [ | |
| 4094 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4095 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4096 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4097 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4098 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4099 | + ], | |
| 4100 | + 'default' => 'solid', | |
| 4101 | + 'selectors' => [ | |
| 4102 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-style: {{VALUE}};', | |
| 4103 | + ], | |
| 4104 | + 'separator' => 'before', | |
| 4105 | + ] | |
| 4106 | + ); | |
| 4107 | + | |
| 4108 | + $this->add_responsive_control( | |
| 4109 | + 'separator1_margin', | |
| 4110 | + [ | |
| 4111 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4112 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4113 | + 'size_units' => ['px', '%'], | |
| 4114 | + 'default' => [ | |
| 4115 | + 'top' => 13, | |
| 4116 | + 'right' => 0, | |
| 4117 | + 'bottom' => 0, | |
| 4118 | + 'left' => 0, | |
| 4119 | + ], | |
| 4120 | + 'render_type' => 'template', | |
| 4121 | + 'selectors' => [ | |
| 4122 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4123 | + ], | |
| 4124 | + ] | |
| 4125 | + ); | |
| 4126 | + | |
| 4127 | + $this->add_control( | |
| 4128 | + 'separator1_radius', | |
| 4129 | + [ | |
| 4130 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 4131 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4132 | + 'size_units' => ['px', '%'], | |
| 4133 | + 'default' => [ | |
| 4134 | + 'top' => 0, | |
| 4135 | + 'right' => 0, | |
| 4136 | + 'bottom' => 0, | |
| 4137 | + 'left' => 0, | |
| 4138 | + ], | |
| 4139 | + 'selectors' => [ | |
| 4140 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4141 | + ], | |
| 4142 | + 'separator' => 'before', | |
| 4143 | + ] | |
| 4144 | + ); | |
| 4145 | + | |
| 4146 | + $this->end_controls_section(); | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + $this->start_controls_section( | |
| 4150 | + 'section_style_separator2', | |
| 4151 | + [ | |
| 4152 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 2', 'king-addons'), | |
| 4153 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4154 | + 'show_label' => false, | |
| 4155 | + ] | |
| 4156 | + ); | |
| 4157 | + | |
| 4158 | + $this->add_control( | |
| 4159 | + 'separator2_color', | |
| 4160 | + [ | |
| 4161 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4162 | + 'type' => Controls_Manager::COLOR, | |
| 4163 | + 'default' => '#ffffff', | |
| 4164 | + 'selectors' => [ | |
| 4165 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-color: {{VALUE}}', | |
| 4166 | + ], | |
| 4167 | + ] | |
| 4168 | + ); | |
| 4169 | + | |
| 4170 | + $this->add_control( | |
| 4171 | + 'separator2_width', | |
| 4172 | + [ | |
| 4173 | + 'label' => esc_html__('Width', 'king-addons'), | |
| 4174 | + 'type' => Controls_Manager::SLIDER, | |
| 4175 | + 'size_units' => ['px', '%'], | |
| 4176 | + 'range' => [ | |
| 4177 | + 'px' => [ | |
| 4178 | + 'min' => 0, | |
| 4179 | + 'max' => 300, | |
| 4180 | + ], | |
| 4181 | + '%' => [ | |
| 4182 | + 'min' => 0, | |
| 4183 | + 'max' => 100, | |
| 4184 | + ], | |
| 4185 | + ], | |
| 4186 | + 'default' => [ | |
| 4187 | + 'unit' => '%', | |
| 4188 | + 'size' => 20, | |
| 4189 | + ], | |
| 4190 | + 'selectors' => [ | |
| 4191 | + '{{WRAPPER}} .king-addons-grid-sep-style-2:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};', | |
| 4192 | + '{{WRAPPER}} .king-addons-grid-sep-style-2.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};', | |
| 4193 | + ], | |
| 4194 | + 'render_type' => 'template', | |
| 4195 | + 'separator' => 'before', | |
| 4196 | + ] | |
| 4197 | + ); | |
| 4198 | + | |
| 4199 | + $this->add_control( | |
| 4200 | + 'separator2_height', | |
| 4201 | + [ | |
| 4202 | + 'label' => esc_html__('Height', 'king-addons'), | |
| 4203 | + 'type' => Controls_Manager::SLIDER, | |
| 4204 | + 'size_units' => ['px'], | |
| 4205 | + 'range' => [ | |
| 4206 | + 'px' => [ | |
| 4207 | + 'min' => 0, | |
| 4208 | + 'max' => 100, | |
| 4209 | + ], | |
| 4210 | + ], | |
| 4211 | + 'default' => [ | |
| 4212 | + 'unit' => 'px', | |
| 4213 | + 'size' => 2, | |
| 4214 | + ], | |
| 4215 | + 'selectors' => [ | |
| 4216 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};', | |
| 4217 | + ], | |
| 4218 | + 'render_type' => 'template', | |
| 4219 | + ] | |
| 4220 | + ); | |
| 4221 | + | |
| 4222 | + $this->add_control( | |
| 4223 | + 'separator2_border_type', | |
| 4224 | + [ | |
| 4225 | + 'label' => esc_html__('Type', 'king-addons'), | |
| 4226 | + 'type' => Controls_Manager::SELECT, | |
| 4227 | + 'options' => [ | |
| 4228 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4229 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4230 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4231 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4232 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4233 | + ], | |
| 4234 | + 'default' => 'solid', | |
| 4235 | + 'selectors' => [ | |
| 4236 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-style: {{VALUE}};', | |
| 4237 | + ], | |
| 4238 | + 'separator' => 'before', | |
| 4239 | + ] | |
| 4240 | + ); | |
| 4241 | + | |
| 4242 | + $this->add_responsive_control( | |
| 4243 | + 'separator2_margin', | |
| 4244 | + [ | |
| 4245 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4246 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4247 | + 'size_units' => ['px', '%'], | |
| 4248 | + 'default' => [ | |
| 4249 | + 'top' => 13, | |
| 4250 | + 'right' => 0, | |
| 4251 | + 'bottom' => 0, | |
| 4252 | + 'left' => 0, | |
| 4253 | + ], | |
| 4254 | + 'selectors' => [ | |
| 4255 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4256 | + ], | |
| 4257 | + 'render_type' => 'template', | |
| 4258 | + ] | |
| 4259 | + ); | |
| 4260 | + | |
| 4261 | + $this->add_control( | |
| 4262 | + 'separator2_radius', | |
| 4263 | + [ | |
| 4264 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 4265 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4266 | + 'size_units' => ['px', '%'], | |
| 4267 | + 'default' => [ | |
| 4268 | + 'top' => 0, | |
| 4269 | + 'right' => 0, | |
| 4270 | + 'bottom' => 0, | |
| 4271 | + 'left' => 0, | |
| 4272 | + ], | |
| 4273 | + 'selectors' => [ | |
| 4274 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4275 | + ], | |
| 4276 | + 'separator' => 'before', | |
| 4277 | + ] | |
| 4278 | + ); | |
| 4279 | + | |
| 4280 | + $this->end_controls_section(); | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + $this->start_controls_section( | |
| 4284 | + 'section_style_tax1', | |
| 4285 | + [ | |
| 4286 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Taxonomy Style 1', 'king-addons'), | |
| 4287 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4288 | + 'show_label' => false, | |
| 4289 | + ] | |
| 4290 | + ); | |
| 4291 | + | |
| 4292 | + $this->start_controls_tabs('tabs_grid_tax1_style'); | |
| 4293 | + | |
| 4294 | + $this->start_controls_tab( | |
| 4295 | + 'tab_grid_tax1_normal', | |
| 4296 | + [ | |
| 4297 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 4298 | + ] | |
| 4299 | + ); | |
| 4300 | + | |
| 4301 | + $this->add_control( | |
| 4302 | + 'tax1_color', | |
| 4303 | + [ | |
| 4304 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4305 | + 'type' => Controls_Manager::COLOR, | |
| 4306 | + 'default' => '#ffffff', | |
| 4307 | + 'selectors' => [ | |
| 4308 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'color: {{VALUE}}', | |
| 4309 | + ], | |
| 4310 | + ] | |
| 4311 | + ); | |
| 4312 | + | |
| 4313 | + $this->add_control( | |
| 4314 | + 'tax1_bg_color', | |
| 4315 | + [ | |
| 4316 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4317 | + 'type' => Controls_Manager::COLOR, | |
| 4318 | + 'selectors' => [ | |
| 4319 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'background-color: {{VALUE}}', | |
| 4320 | + ] | |
| 4321 | + ] | |
| 4322 | + ); | |
| 4323 | + | |
| 4324 | + $this->add_control( | |
| 4325 | + 'tax1_border_color', | |
| 4326 | + [ | |
| 4327 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4328 | + 'type' => Controls_Manager::COLOR, | |
| 4329 | + 'default' => '#E8E8E8', | |
| 4330 | + 'selectors' => [ | |
| 4331 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-color: {{VALUE}}', | |
| 4332 | + ], | |
| 4333 | + ] | |
| 4334 | + ); | |
| 4335 | + | |
| 4336 | + $this->add_control( | |
| 4337 | + 'tax1_extra_text_color', | |
| 4338 | + [ | |
| 4339 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 4340 | + 'type' => Controls_Manager::COLOR, | |
| 4341 | + 'selectors' => [ | |
| 4342 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 4343 | + ], | |
| 4344 | + ] | |
| 4345 | + ); | |
| 4346 | + | |
| 4347 | + $this->add_control( | |
| 4348 | + 'tax1_extra_icon_color', | |
| 4349 | + [ | |
| 4350 | + 'label' => esc_html__('Extra Icon Color', 'king-addons'), | |
| 4351 | + 'type' => Controls_Manager::COLOR, | |
| 4352 | + 'selectors' => [ | |
| 4353 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}', | |
| 4354 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}' | |
| 4355 | + ], | |
| 4356 | + 'separator' => 'after', | |
| 4357 | + ] | |
| 4358 | + ); | |
| 4359 | + | |
| 4360 | + $this->add_control_tax1_custom_colors($tax_meta_keys[1]); | |
| 4361 | + | |
| 4362 | + $this->end_controls_tab(); | |
| 4363 | + | |
| 4364 | + $this->start_controls_tab( | |
| 4365 | + 'tab_grid_tax1_hover', | |
| 4366 | + [ | |
| 4367 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 4368 | + ] | |
| 4369 | + ); | |
| 4370 | + | |
| 4371 | + $this->add_control( | |
| 4372 | + 'tax1_color_hr', | |
| 4373 | + [ | |
| 4374 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4375 | + 'type' => Controls_Manager::COLOR, | |
| 4376 | + 'default' => '#5B03FF', | |
| 4377 | + 'selectors' => [ | |
| 4378 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'color: {{VALUE}}', | |
| 4379 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:before' => 'background-color: {{VALUE}}', | |
| 4380 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:after' => 'background-color: {{VALUE}}', | |
| 4381 | + ], | |
| 4382 | + ] | |
| 4383 | + ); | |
| 4384 | + | |
| 4385 | + $this->add_control( | |
| 4386 | + 'tax1_bg_color_hr', | |
| 4387 | + [ | |
| 4388 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4389 | + 'type' => Controls_Manager::COLOR, | |
| 4390 | + 'selectors' => [ | |
| 4391 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 4392 | + ] | |
| 4393 | + ] | |
| 4394 | + ); | |
| 4395 | + | |
| 4396 | + $this->add_control( | |
| 4397 | + 'tax1_border_color_hr', | |
| 4398 | + [ | |
| 4399 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4400 | + 'type' => Controls_Manager::COLOR, | |
| 4401 | + 'default' => '#E8E8E8', | |
| 4402 | + 'selectors' => [ | |
| 4403 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 4404 | + ], | |
| 4405 | + ] | |
| 4406 | + ); | |
| 4407 | + | |
| 4408 | + $this->add_control_tax1_pointer_color_hr(); | |
| 4409 | + | |
| 4410 | + $this->end_controls_tab(); | |
| 4411 | + | |
| 4412 | + $this->end_controls_tabs(); | |
| 4413 | + | |
| 4414 | + $this->add_control_tax1_pointer(); | |
| 4415 | + | |
| 4416 | + $this->add_control_tax1_pointer_height(); | |
| 4417 | + | |
| 4418 | + $this->add_control_tax1_pointer_animation(); | |
| 4419 | + | |
| 4420 | + $this->add_control( | |
| 4421 | + 'tax1_transition_duration', | |
| 4422 | + [ | |
| 4423 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 4424 | + 'type' => Controls_Manager::NUMBER, | |
| 4425 | + 'default' => 0.1, | |
| 4426 | + 'min' => 0, | |
| 4427 | + 'max' => 5, | |
| 4428 | + 'step' => 0.1, | |
| 4429 | + 'selectors' => [ | |
| 4430 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 4431 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s', | |
| 4432 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s', | |
| 4433 | + ], | |
| 4434 | + 'separator' => 'after', | |
| 4435 | + ] | |
| 4436 | + ); | |
| 4437 | + | |
| 4438 | + $this->add_group_control( | |
| 4439 | + Group_Control_Typography::get_type(), | |
| 4440 | + [ | |
| 4441 | + 'name' => 'tax1_typography', | |
| 4442 | + 'selector' => '{{WRAPPER}} .king-addons-grid-tax-style-1' | |
| 4443 | + ] | |
| 4444 | + ); | |
| 4445 | + | |
| 4446 | + $this->add_control( | |
| 4447 | + 'tax1_border_type', | |
| 4448 | + [ | |
| 4449 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 4450 | + 'type' => Controls_Manager::SELECT, | |
| 4451 | + 'options' => [ | |
| 4452 | + 'none' => esc_html__('None', 'king-addons'), | |
| 4453 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4454 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4455 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4456 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4457 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4458 | + ], | |
| 4459 | + 'default' => 'none', | |
| 4460 | + 'selectors' => [ | |
| 4461 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-style: {{VALUE}};', | |
| 4462 | + ], | |
| 4463 | + 'render_type' => 'template', | |
| 4464 | + 'separator' => 'before', | |
| 4465 | + ] | |
| 4466 | + ); | |
| 4467 | + | |
| 4468 | + $this->add_control( | |
| 4469 | + 'tax1_border_width', | |
| 4470 | + [ | |
| 4471 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 4472 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4473 | + 'size_units' => ['px'], | |
| 4474 | + 'default' => [ | |
| 4475 | + 'top' => 1, | |
| 4476 | + 'right' => 1, | |
| 4477 | + 'bottom' => 1, | |
| 4478 | + 'left' => 1, | |
| 4479 | + ], | |
| 4480 | + 'selectors' => [ | |
| 4481 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4482 | + ], | |
| 4483 | + 'render_type' => 'template', | |
| 4484 | + 'condition' => [ | |
| 4485 | + 'tax1_border_type!' => 'none', | |
| 4486 | + ], | |
| 4487 | + ] | |
| 4488 | + ); | |
| 4489 | + | |
| 4490 | + $this->add_control( | |
| 4491 | + 'tax1_text_spacing', | |
| 4492 | + [ | |
| 4493 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 4494 | + 'type' => Controls_Manager::SLIDER, | |
| 4495 | + 'size_units' => ['px'], | |
| 4496 | + 'range' => [ | |
| 4497 | + 'px' => [ | |
| 4498 | + 'min' => 0, | |
| 4499 | + 'max' => 25, | |
| 4500 | + ], | |
| 4501 | + ], | |
| 4502 | + 'default' => [ | |
| 4503 | + 'unit' => 'px', | |
| 4504 | + 'size' => 5, | |
| 4505 | + ], | |
| 4506 | + 'selectors' => [ | |
| 4507 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 4508 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 4509 | + ], | |
| 4510 | + 'render_type' => 'template', | |
| 4511 | + 'separator' => 'before', | |
| 4512 | + ] | |
| 4513 | + ); | |
| 4514 | + | |
| 4515 | + $this->add_control( | |
| 4516 | + 'tax1_icon_spacing', | |
| 4517 | + [ | |
| 4518 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 4519 | + 'type' => Controls_Manager::SLIDER, | |
| 4520 | + 'size_units' => ['px'], | |
| 4521 | + 'range' => [ | |
| 4522 | + 'px' => [ | |
| 4523 | + 'min' => 0, | |
| 4524 | + 'max' => 25, | |
| 4525 | + ], | |
| 4526 | + ], | |
| 4527 | + 'default' => [ | |
| 4528 | + 'unit' => 'px', | |
| 4529 | + 'size' => 5, | |
| 4530 | + ], | |
| 4531 | + 'selectors' => [ | |
| 4532 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 4533 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 4534 | + ], | |
| 4535 | + ] | |
| 4536 | + ); | |
| 4537 | + | |
| 4538 | + $this->add_control( | |
| 4539 | + 'tax1_gutter', | |
| 4540 | + [ | |
| 4541 | + 'label' => esc_html__('Gutter', 'king-addons'), | |
| 4542 | + 'type' => Controls_Manager::SLIDER, | |
| 4543 | + 'size_units' => ['px'], | |
| 4544 | + 'range' => [ | |
| 4545 | + 'px' => [ | |
| 4546 | + 'min' => 0, | |
| 4547 | + 'max' => 20, | |
| 4548 | + ], | |
| 4549 | + ], | |
| 4550 | + 'default' => [ | |
| 4551 | + 'unit' => 'px', | |
| 4552 | + 'size' => 3, | |
| 4553 | + ], | |
| 4554 | + 'selectors' => [ | |
| 4555 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 4556 | + ], | |
| 4557 | + 'render_type' => 'template', | |
| 4558 | + 'separator' => 'before', | |
| 4559 | + ] | |
| 4560 | + ); | |
| 4561 | + | |
| 4562 | + $this->add_responsive_control( | |
| 4563 | + 'tax1_padding', | |
| 4564 | + [ | |
| 4565 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 4566 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4567 | + 'size_units' => ['px', '%'], | |
| 4568 | + 'default' => [ | |
| 4569 | + 'top' => 0, | |
| 4570 | + 'right' => 0, | |
| 4571 | + 'bottom' => 0, | |
| 4572 | + 'left' => 0, | |
| 4573 | + ], | |
| 4574 | + 'selectors' => [ | |
| 4575 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4576 | + ], | |
| 4577 | + 'render_type' => 'template', | |
| 4578 | + ] | |
| 4579 | + ); | |
| 4580 | + | |
| 4581 | + $this->add_responsive_control( | |
| 4582 | + 'tax1_margin', | |
| 4583 | + [ | |
| 4584 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4585 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4586 | + 'size_units' => ['px', '%'], | |
| 4587 | + 'default' => [ | |
| 4588 | + 'top' => 0, | |
| 4589 | + 'right' => 0, | |
| 4590 | + 'bottom' => 0, | |
| 4591 | + 'left' => 22, | |
| 4592 | + ], | |
| 4593 | + 'selectors' => [ | |
| 4594 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4595 | + ], | |
| 4596 | + 'render_type' => 'template', | |
| 4597 | + ] | |
| 4598 | + ); | |
| 4599 | + | |
| 4600 | + $this->add_control( | |
| 4601 | + 'tax1_radius', | |
| 4602 | + [ | |
| 4603 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 4604 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4605 | + 'size_units' => ['px', '%'], | |
| 4606 | + 'default' => [ | |
| 4607 | + 'top' => 2, | |
| 4608 | + 'right' => 2, | |
| 4609 | + 'bottom' => 2, | |
| 4610 | + 'left' => 2, | |
| 4611 | + ], | |
| 4612 | + 'selectors' => [ | |
| 4613 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4614 | + ], | |
| 4615 | + 'separator' => 'before', | |
| 4616 | + ] | |
| 4617 | + ); | |
| 4618 | + | |
| 4619 | + $this->end_controls_section(); | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + $this->start_controls_section( | |
| 4623 | + 'section_style_tax2', | |
| 4624 | + [ | |
| 4625 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Taxonomy Style 2', 'king-addons'), | |
| 4626 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4627 | + 'show_label' => false, | |
| 4628 | + ] | |
| 4629 | + ); | |
| 4630 | + | |
| 4631 | + $this->start_controls_tabs('tabs_grid_tax2_style'); | |
| 4632 | + | |
| 4633 | + $this->start_controls_tab( | |
| 4634 | + 'tab_grid_tax2_normal', | |
| 4635 | + [ | |
| 4636 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 4637 | + ] | |
| 4638 | + ); | |
| 4639 | + | |
| 4640 | + $this->add_control( | |
| 4641 | + 'tax2_color', | |
| 4642 | + [ | |
| 4643 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4644 | + 'type' => Controls_Manager::COLOR, | |
| 4645 | + 'default' => '#ffffff', | |
| 4646 | + 'selectors' => [ | |
| 4647 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'color: {{VALUE}}', | |
| 4648 | + ], | |
| 4649 | + ] | |
| 4650 | + ); | |
| 4651 | + | |
| 4652 | + $this->add_control( | |
| 4653 | + 'tax2_bg_color', | |
| 4654 | + [ | |
| 4655 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4656 | + 'type' => Controls_Manager::COLOR, | |
| 4657 | + 'default' => '#5B03FF', | |
| 4658 | + 'selectors' => [ | |
| 4659 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'background-color: {{VALUE}}', | |
| 4660 | + ] | |
| 4661 | + ] | |
| 4662 | + ); | |
| 4663 | + | |
| 4664 | + $this->add_control( | |
| 4665 | + 'tax2_border_color', | |
| 4666 | + [ | |
| 4667 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4668 | + 'type' => Controls_Manager::COLOR, | |
| 4669 | + 'default' => '#E8E8E8', | |
| 4670 | + 'selectors' => [ | |
| 4671 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-color: {{VALUE}}', | |
| 4672 | + ], | |
| 4673 | + 'separator' => 'after', | |
| 4674 | + ] | |
| 4675 | + ); | |
| 4676 | + | |
| 4677 | + $this->end_controls_tab(); | |
| 4678 | + | |
| 4679 | + $this->start_controls_tab( | |
| 4680 | + 'tab_grid_tax2_hover', | |
| 4681 | + [ | |
| 4682 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 4683 | + ] | |
| 4684 | + ); | |
| 4685 | + | |
| 4686 | + $this->add_control( | |
| 4687 | + 'tax2_color_hr', | |
| 4688 | + [ | |
| 4689 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4690 | + 'type' => Controls_Manager::COLOR, | |
| 4691 | + 'default' => '#ffffff', | |
| 4692 | + 'selectors' => [ | |
| 4693 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'color: {{VALUE}}', | |
| 4694 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:before' => 'background-color: {{VALUE}}', | |
| 4695 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:after' => 'background-color: {{VALUE}}', | |
| 4696 | + ], | |
| 4697 | + ] | |
| 4698 | + ); | |
| 4699 | + | |
| 4700 | + $this->add_control( | |
| 4701 | + 'tax2_bg_color_hr', | |
| 4702 | + [ | |
| 4703 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4704 | + 'type' => Controls_Manager::COLOR, | |
| 4705 | + 'default' => '#4D02D8', | |
| 4706 | + 'selectors' => [ | |
| 4707 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 4708 | + ] | |
| 4709 | + ] | |
| 4710 | + ); | |
| 4711 | + | |
| 4712 | + $this->add_control( | |
| 4713 | + 'tax2_border_color_hr', | |
| 4714 | + [ | |
| 4715 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4716 | + 'type' => Controls_Manager::COLOR, | |
| 4717 | + 'default' => '#E8E8E8', | |
| 4718 | + 'selectors' => [ | |
| 4719 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 4720 | + ], | |
| 4721 | + ] | |
| 4722 | + ); | |
| 4723 | + | |
| 4724 | + $this->add_control_tax2_pointer_color_hr(); | |
| 4725 | + | |
| 4726 | + $this->end_controls_tab(); | |
| 4727 | + | |
| 4728 | + $this->end_controls_tabs(); | |
| 4729 | + | |
| 4730 | + $this->add_control_tax2_pointer(); | |
| 4731 | + | |
| 4732 | + $this->add_control_tax2_pointer_height(); | |
| 4733 | + | |
| 4734 | + $this->add_control_tax2_pointer_animation(); | |
| 4735 | + | |
| 4736 | + $this->add_control( | |
| 4737 | + 'tax2_transition_duration', | |
| 4738 | + [ | |
| 4739 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 4740 | + 'type' => Controls_Manager::NUMBER, | |
| 4741 | + 'default' => 0.1, | |
| 4742 | + 'min' => 0, | |
| 4743 | + 'max' => 5, | |
| 4744 | + 'step' => 0.1, | |
| 4745 | + 'selectors' => [ | |
| 4746 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 4747 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s', | |
| 4748 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s', | |
| 4749 | + ], | |
| 4750 | + 'separator' => 'after', | |
| 4751 | + ] | |
| 4752 | + ); | |
| 4753 | + | |
| 4754 | + $this->add_group_control( | |
| 4755 | + Group_Control_Typography::get_type(), | |
| 4756 | + [ | |
| 4757 | + 'name' => 'tax2_typography', | |
| 4758 | + 'selector' => '{{WRAPPER}} .king-addons-grid-tax-style-2' | |
| 4759 | + ] | |
| 4760 | + ); | |
| 4761 | + | |
| 4762 | + $this->add_control( | |
| 4763 | + 'tax2_border_type', | |
| 4764 | + [ | |
| 4765 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 4766 | + 'type' => Controls_Manager::SELECT, | |
| 4767 | + 'options' => [ | |
| 4768 | + 'none' => esc_html__('None', 'king-addons'), | |
| 4769 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4770 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4771 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4772 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4773 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4774 | + ], | |
| 4775 | + 'default' => 'none', | |
| 4776 | + 'selectors' => [ | |
| 4777 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-style: {{VALUE}};', | |
| 4778 | + ], | |
| 4779 | + 'render_type' => 'template', | |
| 4780 | + 'separator' => 'before', | |
| 4781 | + ] | |
| 4782 | + ); | |
| 4783 | + | |
| 4784 | + $this->add_control( | |
| 4785 | + 'tax2_border_width', | |
| 4786 | + [ | |
| 4787 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 4788 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4789 | + 'size_units' => ['px'], | |
| 4790 | + 'default' => [ | |
| 4791 | + 'top' => 1, | |
| 4792 | + 'right' => 1, | |
| 4793 | + 'bottom' => 1, | |
| 4794 | + 'left' => 1, | |
| 4795 | + ], | |
| 4796 | + 'selectors' => [ | |
| 4797 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4798 | + ], | |
| 4799 | + 'render_type' => 'template', | |
| 4800 | + 'condition' => [ | |
| 4801 | + 'tax2_border_type!' => 'none', | |
| 4802 | + ], | |
| 4803 | + ] | |
| 4804 | + ); | |
| 4805 | + | |
| 4806 | + $this->add_control( | |
| 4807 | + 'tax2_text_spacing', | |
| 4808 | + [ | |
| 4809 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 4810 | + 'type' => Controls_Manager::SLIDER, | |
| 4811 | + 'size_units' => ['px'], | |
| 4812 | + 'range' => [ | |
| 4813 | + 'px' => [ | |
| 4814 | + 'min' => 0, | |
| 4815 | + 'max' => 25, | |
| 4816 | + ], | |
| 4817 | + ], | |
| 4818 | + 'default' => [ | |
| 4819 | + 'unit' => 'px', | |
| 4820 | + 'size' => 5, | |
| 4821 | + ], | |
| 4822 | + 'selectors' => [ | |
| 4823 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 4824 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 4825 | + ], | |
| 4826 | + 'separator' => 'before', | |
| 4827 | + ] | |
| 4828 | + ); | |
| 4829 | + | |
| 4830 | + $this->add_control( | |
| 4831 | + 'tax2_icon_spacing', | |
| 4832 | + [ | |
| 4833 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 4834 | + 'type' => Controls_Manager::SLIDER, | |
| 4835 | + 'size_units' => ['px'], | |
| 4836 | + 'range' => [ | |
| 4837 | + 'px' => [ | |
| 4838 | + 'min' => 0, | |
| 4839 | + 'max' => 25, | |
| 4840 | + ], | |
| 4841 | + ], | |
| 4842 | + 'default' => [ | |
| 4843 | + 'unit' => 'px', | |
| 4844 | + 'size' => 5, | |
| 4845 | + ], | |
| 4846 | + 'selectors' => [ | |
| 4847 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 4848 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 4849 | + ], | |
| 4850 | + ] | |
| 4851 | + ); | |
| 4852 | + | |
| 4853 | + $this->add_control( | |
| 4854 | + 'tax2_gutter', | |
| 4855 | + [ | |
| 4856 | + 'label' => esc_html__('Gutter', 'king-addons'), | |
| 4857 | + 'type' => Controls_Manager::SLIDER, | |
| 4858 | + 'size_units' => ['px'], | |
| 4859 | + 'range' => [ | |
| 4860 | + 'px' => [ | |
| 4861 | + 'min' => 0, | |
| 4862 | + 'max' => 20, | |
| 4863 | + ], | |
| 4864 | + ], | |
| 4865 | + 'default' => [ | |
| 4866 | + 'unit' => 'px', | |
| 4867 | + 'size' => 3, | |
| 4868 | + ], | |
| 4869 | + 'selectors' => [ | |
| 4870 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 4871 | + ], | |
| 4872 | + 'render_type' => 'template', | |
| 4873 | + 'separator' => 'before', | |
| 4874 | + ] | |
| 4875 | + ); | |
| 4876 | + | |
| 4877 | + $this->add_responsive_control( | |
| 4878 | + 'tax2_padding', | |
| 4879 | + [ | |
| 4880 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 4881 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4882 | + 'size_units' => ['px', '%'], | |
| 4883 | + 'default' => [ | |
| 4884 | + 'top' => 2, | |
| 4885 | + 'right' => 5, | |
| 4886 | + 'bottom' => 2, | |
| 4887 | + 'left' => 5, | |
| 4888 | + ], | |
| 4889 | + 'selectors' => [ | |
| 4890 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4891 | + ], | |
| 4892 | + 'render_type' => 'template', | |
| 4893 | + ] | |
| 4894 | + ); | |
| 4895 | + | |
| 4896 | + $this->add_responsive_control( | |
| 4897 | + 'tax2_margin', | |
| 4898 | + [ | |
| 4899 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4900 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4901 | + 'size_units' => ['px', '%'], | |
| 4902 | + 'default' => [ | |
| 4903 | + 'top' => 0, | |
| 4904 | + 'right' => 0, | |
| 4905 | + 'bottom' => 0, | |
| 4906 | + 'left' => 20, | |
| 4907 | + ], | |
| 4908 | + 'selectors' => [ | |
| 4909 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4910 | + ], | |
| 4911 | + 'render_type' => 'template', | |
| 4912 | + ] | |
| 4913 | + ); | |
| 4914 | + | |
| 4915 | + $this->add_control( | |
| 4916 | + 'tax2_radius', | |
| 4917 | + [ | |
| 4918 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 4919 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4920 | + 'size_units' => ['px', '%'], | |
| 4921 | + 'default' => [ | |
| 4922 | + 'top' => 2, | |
| 4923 | + 'right' => 2, | |
| 4924 | + 'bottom' => 2, | |
| 4925 | + 'left' => 2, | |
| 4926 | + ], | |
| 4927 | + 'selectors' => [ | |
| 4928 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4929 | + ], | |
| 4930 | + 'separator' => 'before', | |
| 4931 | + ] | |
| 4932 | + ); | |
| 4933 | + | |
| 4934 | + $this->end_controls_section(); | |
| 4935 | + | |
| 4936 | + | |
| 4937 | + $this->add_section_style_custom_field1(); | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + $this->add_section_style_custom_field2(); | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + $this->add_section_style_grid_slider_nav(); | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + $this->start_controls_section( | |
| 4947 | + 'section_style_pwd_protected', | |
| 4948 | + [ | |
| 4949 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Password Protected', 'king-addons'), | |
| 4950 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4951 | + 'show_label' => false, | |
| 4952 | + ] | |
| 4953 | + ); | |
| 4954 | + | |
| 4955 | + $this->add_control( | |
| 4956 | + 'pwd_protected_color', | |
| 4957 | + [ | |
| 4958 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4959 | + 'type' => Controls_Manager::COLOR, | |
| 4960 | + 'default' => '#9c9c9c', | |
| 4961 | + 'selectors' => [ | |
| 4962 | + '{{WRAPPER}} .king-addons-grid-item-protected' => 'color: {{VALUE}}', | |
| 4963 | + ], | |
| 4964 | + ] | |
| 4965 | + ); | |
| 4966 | + | |
| 4967 | + $this->add_control( | |
| 4968 | + 'pwd_protected_bg_color', | |
| 4969 | + [ | |
| 4970 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4971 | + 'type' => Controls_Manager::COLOR, | |
| 4972 | + 'default' => '#5B03FF', | |
| 4973 | + 'selectors' => [ | |
| 4974 | + '{{WRAPPER}} .king-addons-grid-item-protected' => 'background-color: {{VALUE}}', | |
| 4975 | + ] | |
| 4976 | + ] | |
| 4977 | + ); | |
| 4978 | + | |
| 4979 | + $this->add_control( | |
| 4980 | + 'pwd_protected_input_color', | |
| 4981 | + [ | |
| 4982 | + 'label' => esc_html__('Input Background Color', 'king-addons'), | |
| 4983 | + 'type' => Controls_Manager::COLOR, | |
| 4984 | + 'default' => '#ffffff', | |
| 4985 | + 'selectors' => [ | |
| 4986 | + '{{WRAPPER}} .king-addons-grid-item-protected input' => 'background-color: {{VALUE}}', | |
| 4987 | + ] | |
| 4988 | + ] | |
| 4989 | + ); | |
| 4990 | + | |
| 4991 | + $this->add_group_control( | |
| 4992 | + Group_Control_Typography::get_type(), | |
| 4993 | + [ | |
| 4994 | + 'name' => 'pwd_protected_typography', | |
| 4995 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-protected p' | |
| 4996 | + ] | |
| 4997 | + ); | |
| 4998 | + | |
| 4999 | + $this->end_controls_section(); | |
| 5000 | + | |
| 5001 | + } | |
| 5002 | + | |
| 5003 | + public function get_related_taxonomies() | |
| 5004 | + { | |
| 5005 | + $relations = []; | |
| 5006 | + foreach (Core::getCustomTypes('post', false) as $slug => $title) { | |
| 5007 | + // `get_object_taxonomies` already returns an array; assign it directly | |
| 5008 | + $relations[$slug] = get_object_taxonomies($slug); | |
| 5009 | + } | |
| 5010 | + return json_encode($relations); | |
| 5011 | + } | |
| 5012 | + | |
| 5013 | + public function get_max_num_pages() | |
| 5014 | + { | |
| 5015 | + $query = new WP_Query($this->get_main_query_args(0)); | |
| 5016 | + wp_reset_postdata(); | |
| 5017 | + return (int)ceil($query->max_num_pages); | |
| 5018 | + } | |
| 5019 | + | |
| 5020 | + public function get_main_query_args($slide_offset) | |
| 5021 | + { | |
| 5022 | + $settings = Core::displaySettings($this); | |
| 5023 | + $author = !empty($settings['query_author']) ? implode(',', $settings['query_author']) : ''; | |
| 5024 | + $paged = get_query_var('paged') ?: (get_query_var('page') ?: 1); | |
| 5025 | + | |
| 5026 | + // Handle no-premium settings | |
| 5027 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 5028 | + $restricted_layouts = ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h']; | |
| 5029 | + if (in_array($settings['king_addons_grid_layout_select'], $restricted_layouts, true)) { | |
| 5030 | + $settings['king_addons_grid_layout_select'] = '1-1-3'; | |
| 5031 | + } | |
| 5032 | + $settings['slider_enable'] = ''; | |
| 5033 | + $settings['query_randomize'] = ''; | |
| 5034 | + $settings['order_posts'] = 'date'; | |
| 5035 | + } | |
| 5036 | + | |
| 5037 | + // Determine posts per page based on layout | |
| 5038 | + switch ($settings['king_addons_grid_layout_select']) { | |
| 5039 | + case '1-2': | |
| 5040 | + case '1-1-1': | |
| 5041 | + $query_posts_per_page = 3; | |
| 5042 | + break; | |
| 5043 | + case '1-3': | |
| 5044 | + case '1-1-2': | |
| 5045 | + case '1vh-3h': | |
| 5046 | + $query_posts_per_page = 4; | |
| 5047 | + break; | |
| 5048 | + case '1-4': | |
| 5049 | + case '2-1-2': | |
| 5050 | + case '1-1-3': | |
| 5051 | + case '2-3': | |
| 5052 | + $query_posts_per_page = 5; | |
| 5053 | + break; | |
| 5054 | + case '2-h': | |
| 5055 | + $query_posts_per_page = 2 * (int)$settings['layout_rows_number']; | |
| 5056 | + break; | |
| 5057 | + case '3-h': | |
| 5058 | + $query_posts_per_page = 3 * (int)$settings['layout_rows_number']; | |
| 5059 | + break; | |
| 5060 | + case '4-h': | |
| 5061 | + $query_posts_per_page = 4 * (int)$settings['layout_rows_number']; | |
| 5062 | + break; | |
| 5063 | + default: | |
| 5064 | + $query_posts_per_page = 3; // Fallback if something else | |
| 5065 | + break; | |
| 5066 | + } | |
| 5067 | + | |
| 5068 | + $settings['query_offset'] = !empty($settings['query_offset']) ? $settings['query_offset'] : 0; | |
| 5069 | + $offset = ($paged - 1) * $query_posts_per_page + $settings['query_offset']; | |
| 5070 | + $query_order_by = (!empty($settings['query_randomize'])) ? $settings['query_randomize'] : $settings['order_posts']; | |
| 5071 | + | |
| 5072 | + // Override random on front page if not a blog archive | |
| 5073 | + if (is_front_page() && !Core::isBlogArchive()) { | |
| 5074 | + $query_order_by = $settings['order_posts']; | |
| 5075 | + } | |
| 5076 | + | |
| 5077 | + // Adjust offset for slider | |
| 5078 | + if ('yes' === $settings['slider_enable']) { | |
| 5079 | + $offset += $query_posts_per_page * $slide_offset; | |
| 5080 | + } | |
| 5081 | + | |
| 5082 | + // Default arguments | |
| 5083 | + $args = [ | |
| 5084 | + 'post_type' => $settings['query_source'], | |
| 5085 | + 'tax_query' => $this->get_tax_query_args(), | |
| 5086 | + 'post__not_in' => $settings['query_exclude_' . $settings['query_source']], | |
| 5087 | + 'posts_per_page' => $query_posts_per_page, | |
| 5088 | + 'orderby' => $query_order_by, | |
| 5089 | + 'author' => $author, | |
| 5090 | + 'paged' => $paged, | |
| 5091 | + 'offset' => $offset, | |
| 5092 | + ]; | |
| 5093 | + | |
| 5094 | + // Exclude posts with no images | |
| 5095 | + if ('yes' === $settings['query_exclude_no_images']) { | |
| 5096 | + $args['meta_key'] = '_thumbnail_id'; | |
| 5097 | + } | |
| 5098 | + | |
| 5099 | + // Manual selection override | |
| 5100 | + if ('manual' === $settings['query_selection']) { | |
| 5101 | + $post_ids = !empty($settings['query_manual_' . $settings['query_source']]) | |
| 5102 | + ? $settings['query_manual_' . $settings['query_source']] | |
| 5103 | + : ['']; | |
| 5104 | + | |
| 5105 | + $args = [ | |
| 5106 | + 'post_type' => $settings['query_source'], | |
| 5107 | + 'post__in' => $post_ids, | |
| 5108 | + 'orderby' => $query_order_by, | |
| 5109 | + 'posts_per_page' => $query_posts_per_page, | |
| 5110 | + 'offset' => $query_posts_per_page * $slide_offset, | |
| 5111 | + ]; | |
| 5112 | + } | |
| 5113 | + | |
| 5114 | + // Use current query | |
| 5115 | + if ('current' === $settings['query_source']) { | |
| 5116 | + global $wp_query; | |
| 5117 | + $args = $wp_query->query_vars; | |
| 5118 | + $args['posts_per_page'] = $query_posts_per_page; | |
| 5119 | + $args['orderby'] = $query_order_by; | |
| 5120 | + $args['offset'] = ($paged - 1) * $query_posts_per_page + (int)$settings['query_offset']; | |
| 5121 | + } | |
| 5122 | + | |
| 5123 | + // Related posts | |
| 5124 | + if ('related' === $settings['query_source']) { | |
| 5125 | + $args = [ | |
| 5126 | + 'post_type' => get_post_type(get_the_ID()), | |
| 5127 | + 'tax_query' => $this->get_tax_query_args(), | |
| 5128 | + 'post__not_in' => [get_the_ID()], | |
| 5129 | + 'ignore_sticky_posts' => 1, | |
| 5130 | + 'posts_per_page' => $query_posts_per_page, | |
| 5131 | + 'orderby' => $query_order_by, | |
| 5132 | + 'offset' => $offset, | |
| 5133 | + ]; | |
| 5134 | + } | |
| 5135 | + | |
| 5136 | + // Add 'order' unless random | |
| 5137 | + if ('rand' !== $query_order_by) { | |
| 5138 | + $args['order'] = $settings['order_direction']; | |
| 5139 | + } | |
| 5140 | + | |
| 5141 | + return $args; | |
| 5142 | + } | |
| 5143 | + | |
| 5144 | + public function get_tax_query_args() | |
| 5145 | + { | |
| 5146 | + $settings = Core::displaySettings($this); | |
| 5147 | + | |
| 5148 | + // If "related" source | |
| 5149 | + if ('related' === $settings['query_source']) { | |
| 5150 | + return [ | |
| 5151 | + [ | |
| 5152 | + 'taxonomy' => $settings['query_tax_selection'], | |
| 5153 | + 'field' => 'term_id', | |
| 5154 | + 'terms' => wp_get_object_terms( | |
| 5155 | + get_the_ID(), | |
| 5156 | + $settings['query_tax_selection'], | |
| 5157 | + ['fields' => 'ids'] | |
| 5158 | + ), | |
| 5159 | + ] | |
| 5160 | + ]; | |
| 5161 | + } | |
| 5162 | + | |
| 5163 | + // Else build from normal taxonomies | |
| 5164 | + $tax_query = []; | |
| 5165 | + foreach (get_object_taxonomies($settings['query_source']) as $tax) { | |
| 5166 | + $key = 'query_taxonomy_' . $tax; | |
| 5167 | + if (!empty($settings[$key])) { | |
| 5168 | + $tax_query[] = [ | |
| 5169 | + 'taxonomy' => $tax, | |
| 5170 | + 'field' => 'id', | |
| 5171 | + 'terms' => $settings[$key], | |
| 5172 | + ]; | |
| 5173 | + } | |
| 5174 | + } | |
| 5175 | + return $tax_query; | |
| 5176 | + } | |
| 5177 | + | |
| 5178 | + private function get_animation_class($data, $object) | |
| 5179 | + { | |
| 5180 | + $animation = Grid_Ajax_Security::sanitize_animation($data[$object . '_animation'] ?? 'none'); | |
| 5181 | + if ('none' === $animation) { | |
| 5182 | + return ''; | |
| 5183 | + } | |
| 5184 | + | |
| 5185 | + $class = ' king-addons-' . sanitize_html_class($object) . '-' . $animation; | |
| 5186 | + $class .= ' king-addons-anim-size-' . Grid_Ajax_Security::sanitize_animation_size($data[$object . '_animation_size'] ?? 'large'); | |
| 5187 | + $class .= ' king-addons-animation-timing-' . Grid_Ajax_Security::sanitize_animation_timing($data[$object . '_animation_timing'] ?? 'ease-default'); | |
| 5188 | + | |
| 5189 | + if ('yes' === Grid_Ajax_Security::sanitize_yes_no_switcher($data[$object . '_animation_tr'] ?? '')) { | |
| 5190 | + $class .= ' king-addons-anim-transparency'; | |
| 5191 | + } | |
| 5192 | + return $class; | |
| 5193 | + } | |
| 5194 | + | |
| 5195 | + public function render_password_protected_input() | |
| 5196 | + { | |
| 5197 | + if (!post_password_required()) { | |
| 5198 | + return; | |
| 5199 | + } | |
| 5200 | + | |
| 5201 | + add_filter('the_password_form', function () { | |
| 5202 | + $output = '<form action="' . esc_url(home_url('wp-login.php?action=postpass')) . '" method="post">'; | |
| 5203 | + $output .= '<i class="fas fa-lock"></i>'; | |
| 5204 | + $output .= '<p>' . esc_html(get_the_title()) . '</p>'; | |
| 5205 | + $output .= '<input type="password" name="post_password" id="post-' . esc_attr(get_the_ID()) . '" placeholder="' . esc_html__('Type and hit Enter...', 'king-addons') . '">'; | |
| 5206 | + $output .= '</form>'; | |
| 5207 | + return $output; | |
| 5208 | + }); | |
| 5209 | + | |
| 5210 | + echo '<div class="king-addons-grid-item-protected king-addons-cv-container">'; | |
| 5211 | + echo '<div class="king-addons-cv-outer">'; | |
| 5212 | + echo '<div class="king-addons-cv-inner">'; | |
| 5213 | + echo get_the_password_form(); | |
| 5214 | + echo '</div></div></div>'; | |
| 5215 | + } | |
| 5216 | + | |
| 5217 | + public function render_post_thumbnail($settings, $post_id = null) | |
| 5218 | + { | |
| 5219 | + $id = $post_id ? get_post_thumbnail_id($post_id) : get_post_thumbnail_id(); | |
| 5220 | + $src = Group_Control_Image_Size::get_attachment_image_src($id, 'layout_image_crop', $settings); | |
| 5221 | + | |
| 5222 | + if (has_post_thumbnail()) { | |
| 5223 | + echo '<div class="king-addons-grid-image-wrap" data-src="' . esc_url($src) . '" style="background-image: url(' . esc_url($src) . ')"></div>'; | |
| 5224 | + } | |
| 5225 | + } | |
| 5226 | + | |
| 5227 | + public function render_media_overlay($settings) | |
| 5228 | + { | |
| 5229 | + echo '<div class="king-addons-grid-media-hover-bg ' . esc_attr($this->get_animation_class($settings, 'overlay')) . '" data-url="' . esc_url(get_the_permalink()) . '">'; | |
| 5230 | + if (king_addons_freemius()->can_use_premium_code__premium_only() && !empty($settings['overlay_image']['url'])) { | |
| 5231 | + echo '<img src="' . esc_url($settings['overlay_image']['url']) . '" alt="' . esc_attr($settings['overlay_image']['alt']) . '">'; | |
| 5232 | + } | |
| 5233 | + echo '</div>'; | |
| 5234 | + } | |
| 5235 | + | |
| 5236 | + public function render_post_title($settings, $class) | |
| 5237 | + { | |
| 5238 | + $open_links_in_new_tab = ('yes' === ($settings['open_links_in_new_tab'] ?? '')) ? '_blank' : '_self'; | |
| 5239 | + | |
| 5240 | + // If premium unavailable, fallback pointer settings | |
| 5241 | + $title_pointer = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 5242 | + ? Grid_Ajax_Security::sanitize_class_token($settings['title_pointer'] ?? 'none') | |
| 5243 | + : 'none'; | |
| 5244 | + $title_pointer_animation = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 5245 | + ? Grid_Ajax_Security::sanitize_class_token($settings['title_pointer_animation'] ?? 'fade') | |
| 5246 | + : 'fade'; | |
| 5247 | + | |
| 5248 | + $pointer_item_class = ('none' !== $title_pointer) ? 'class="king-addons-pointer-item"' : ''; | |
| 5249 | + $class .= ' king-addons-pointer-' . $title_pointer; | |
| 5250 | + $class .= ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $title_pointer_animation; | |
| 5251 | + | |
| 5252 | + $element_title_tag = Grid_Ajax_Security::sanitize_html_tag($settings['element_title_tag'] ?? 'h2'); | |
| 5253 | + $trim_type = $settings['element_trim_text_by']; | |
| 5254 | + $limit = $trim_type === 'word_count' ? $settings['element_word_count'] : $settings['element_letter_count']; | |
| 5255 | + $title_text = ($trim_type === 'word_count') | |
| 5256 | + ? wp_trim_words(get_the_title(), $limit) | |
| 5257 | + : mb_substr(html_entity_decode(get_the_title()), 0, $limit) . '...'; | |
| 5258 | + | |
| 5259 | + echo '<' . esc_attr($element_title_tag) . ' class="' . esc_attr($class) . '">'; | |
| 5260 | + echo '<div class="inner-block">'; | |
| 5261 | + echo '<a target="' . esc_attr($open_links_in_new_tab) . '" ' . $pointer_item_class . ' href="' . esc_url(get_the_permalink()) . '">'; | |
| 5262 | + echo esc_html($title_text); | |
| 5263 | + echo '</a></div>'; | |
| 5264 | + echo '</' . esc_attr($element_title_tag) . '>'; | |
| 5265 | + } | |
| 5266 | + | |
| 5267 | + public function render_post_content($settings, $class) | |
| 5268 | + { | |
| 5269 | + if ('' === get_the_content()) { | |
| 5270 | + return; | |
| 5271 | + } | |
| 5272 | + $class .= ('yes' === $settings['element_dropcap']) ? ' king-addons-enable-dropcap' : ''; | |
| 5273 | + | |
| 5274 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 5275 | + echo '<div class="inner-block">'; | |
| 5276 | + echo wp_kses_post(apply_filters('the_content', get_the_content())); | |
| 5277 | + echo '</div></div>'; | |
| 5278 | + } | |
| 5279 | + | |
| 5280 | + public function render_post_excerpt($settings, $class) | |
| 5281 | + { | |
| 5282 | + if ('' === get_the_excerpt()) { | |
| 5283 | + return; | |
| 5284 | + } | |
| 5285 | + $class .= ('yes' === $settings['element_dropcap']) ? ' king-addons-enable-dropcap' : ''; | |
| 5286 | + | |
| 5287 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 5288 | + echo '<div class="inner-block">'; | |
| 5289 | + if ('word_count' === $settings['element_trim_text_by']) { | |
| 5290 | + echo '<p>' . esc_html(wp_trim_words(get_the_excerpt(), $settings['element_word_count'])) . '</p>'; | |
| 5291 | + } else { | |
| 5292 | + $trimmed = implode('', array_slice(str_split(get_the_excerpt()), 0, $settings['element_letter_count'])); | |
| 5293 | + echo '<p>' . esc_html($trimmed) . '...</p>'; | |
| 5294 | + } | |
| 5295 | + echo '</div></div>'; | |
| 5296 | + } | |
| 5297 | + | |
| 5298 | + public function render_post_date($settings, $class) | |
| 5299 | + { | |
| 5300 | + echo '<div class="' . esc_attr($class) . '"><div class="inner-block"><span>'; | |
| 5301 | + $this->render_extra_text_and_icon($settings, 'before'); | |
| 5302 | + | |
| 5303 | + // Show modified time or published time | |
| 5304 | + echo ('yes' === $settings['show_last_update_date']) | |
| 5305 | + ? esc_html(get_the_modified_time(get_option('date_format'))) | |
| 5306 | + : esc_html(apply_filters('the_date', get_the_date(), get_option('date_format'), '', '')); | |
| 5307 | + | |
| 5308 | + $this->render_extra_text_and_icon($settings, 'after'); | |
| 5309 | + echo '</span></div></div>'; | |
| 5310 | + } | |
| 5311 | + | |
| 5312 | + public function render_post_time($settings, $class) | |
| 5313 | + { | |
| 5314 | + echo '<div class="' . esc_attr($class) . '"><div class="inner-block"><span>'; | |
| 5315 | + $this->render_extra_text_and_icon($settings, 'before'); | |
| 5316 | + | |
| 5317 | + echo esc_html(get_the_time()); | |
| 5318 | + | |
| 5319 | + $this->render_extra_text_and_icon($settings, 'after'); | |
| 5320 | + echo '</span></div></div>'; | |
| 5321 | + } | |
| 5322 | + | |
| 5323 | + public function render_post_author($settings, $class) | |
| 5324 | + { | |
| 5325 | + $author_id = get_post_field('post_author'); | |
| 5326 | + | |
| 5327 | + echo '<div class="' . esc_attr($class) . '"><div class="inner-block">'; | |
| 5328 | + $this->render_extra_text_and_icon($settings, 'before'); | |
| 5329 | + | |
| 5330 | + echo '<a href="' . esc_url(get_author_posts_url($author_id)) . '">'; | |
| 5331 | + $this->render_extra_text_and_icon($settings, 'before', true); | |
| 5332 | + | |
| 5333 | + if ('yes' === $settings['element_show_avatar']) { | |
| 5334 | + echo get_avatar($author_id, $settings['element_avatar_size']); | |
| 5335 | + } | |
| 5336 | + echo '<span>' . esc_html(get_the_author_meta('display_name', $author_id)) . '</span>'; | |
| 5337 | + $this->render_extra_text_and_icon($settings, 'after', true); | |
| 5338 | + echo '</a>'; | |
| 5339 | + | |
| 5340 | + $this->render_extra_text_and_icon($settings, 'after'); | |
| 5341 | + echo '</div></div>'; | |
| 5342 | + } | |
| 5343 | + | |
| 5344 | + public function render_post_comments($settings, $class) | |
| 5345 | + { | |
| 5346 | + if (!comments_open()) { | |
| 5347 | + return; | |
| 5348 | + } | |
| 5349 | + $count = get_comments_number(); | |
| 5350 | + if ($count === 1) { | |
| 5351 | + $text = $count . ' ' . $settings['element_comments_text_2']; | |
| 5352 | + } elseif ($count > 1) { | |
| 5353 | + $text = $count . ' ' . $settings['element_comments_text_3']; | |
| 5354 | + } else { | |
| 5355 | + $text = $settings['element_comments_text_1']; | |
| 5356 | + } | |
| 5357 | + | |
| 5358 | + echo '<div class="' . esc_attr($class) . '"><div class="inner-block">'; | |
| 5359 | + $this->render_extra_text_and_icon($settings, 'before'); | |
| 5360 | + | |
| 5361 | + echo '<a href="' . esc_url(get_comments_link()) . '">'; | |
| 5362 | + $this->render_extra_text_and_icon($settings, 'before', true); | |
| 5363 | + echo '<span>' . esc_html($text) . '</span>'; | |
| 5364 | + $this->render_extra_text_and_icon($settings, 'after', true); | |
| 5365 | + echo '</a>'; | |
| 5366 | + | |
| 5367 | + $this->render_extra_text_and_icon($settings, 'after'); | |
| 5368 | + echo '</div></div>'; | |
| 5369 | + } | |
| 5370 | + | |
| 5371 | + public function render_post_read_more($settings, $class) | |
| 5372 | + { | |
| 5373 | + $open_links_in_new_tab = ('yes' === $settings['open_links_in_new_tab']) ? '_blank' : '_self'; | |
| 5374 | + $read_more_animation = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 5375 | + ? $settings['read_more_animation'] | |
| 5376 | + : 'king-addons-button-none'; | |
| 5377 | + | |
| 5378 | + echo '<div class="' . esc_attr($class) . '"><div class="inner-block">'; | |
| 5379 | + echo '<a target="' . esc_attr($open_links_in_new_tab) . '" href="' . esc_url(get_the_permalink()) . '" class="king-addons-button-effect ' . esc_attr($read_more_animation) . '">'; | |
| 5380 | + $this->render_extra_text_and_icon($settings, 'before', true); | |
| 5381 | + echo '<span>' . esc_html($settings['element_read_more_text']) . '</span>'; | |
| 5382 | + $this->render_extra_text_and_icon($settings, 'after', true); | |
| 5383 | + echo '</a>'; | |
| 5384 | + echo '</div></div>'; | |
| 5385 | + } | |
| 5386 | + | |
| 5387 | + public function render_post_likes($settings, $class, $post_id) | |
| 5388 | + { | |
| 5389 | + // Intentionally empty; placeholder for likes | |
| 5390 | + } | |
| 5391 | + | |
| 5392 | + public function render_post_sharing_icons($settings, $class) | |
| 5393 | + { | |
| 5394 | + // Intentionally empty; placeholder for sharing icons | |
| 5395 | + } | |
| 5396 | + | |
| 5397 | + public function render_post_custom_field($settings, $class, $post_id) | |
| 5398 | + { | |
| 5399 | + // Intentionally empty; placeholder for custom fields | |
| 5400 | + } | |
| 5401 | + | |
| 5402 | + public function render_post_element_separator($settings, $class) | |
| 5403 | + { | |
| 5404 | + echo '<div class="' . esc_attr($class . ' ' . ($settings['element_separator_style'] ?? '')) . '">'; | |
| 5405 | + echo '<div class="inner-block"><span></span></div>'; | |
| 5406 | + echo '</div>'; | |
| 5407 | + } | |
| 5408 | + | |
| 5409 | + public function render_post_taxonomies($settings, $class, $post_id) | |
| 5410 | + { | |
| 5411 | + $terms = wp_get_post_terms($post_id, $settings['element_select']); | |
| 5412 | + $count = 0; | |
| 5413 | + $pointer = king_addons_freemius()->can_use_premium_code__premium_only(); | |
| 5414 | + | |
| 5415 | + // Pointer settings | |
| 5416 | + $tax1_pointer = $pointer ? Grid_Ajax_Security::sanitize_class_token(Core::displaySettings($this)['tax1_pointer'] ?? 'none') : 'none'; | |
| 5417 | + $tax1_pointer_animation = $pointer ? Grid_Ajax_Security::sanitize_class_token(Core::displaySettings($this)['tax1_pointer_animation'] ?? 'fade') : 'fade'; | |
| 5418 | + $tax2_pointer = $pointer ? Grid_Ajax_Security::sanitize_class_token(Core::displaySettings($this)['tax2_pointer'] ?? 'none') : 'none'; | |
| 5419 | + $tax2_pointer_animation = $pointer ? Grid_Ajax_Security::sanitize_class_token(Core::displaySettings($this)['tax2_pointer_animation'] ?? 'fade') : 'fade'; | |
| 5420 | + | |
| 5421 | + if ($settings['element_tax_style'] === 'king-addons-grid-tax-style-1') { | |
| 5422 | + $class .= " king-addons-pointer-$tax1_pointer king-addons-pointer-fx-$tax1_pointer_animation"; | |
| 5423 | + } else { | |
| 5424 | + $class .= " king-addons-pointer-$tax2_pointer king-addons-pointer-fx-$tax2_pointer_animation"; | |
| 5425 | + } | |
| 5426 | + $class .= ' king-addons-pointer-line-fx'; | |
| 5427 | + | |
| 5428 | + $pointer_item_class = ( | |
| 5429 | + (isset(Core::displaySettings($this)['tax1_pointer']) && Core::displaySettings($this)['tax1_pointer'] !== 'none') || | |
| 5430 | + (isset(Core::displaySettings($this)['tax2_pointer']) && Core::displaySettings($this)['tax2_pointer'] !== 'none') | |
| 5431 | + ) ? 'king-addons-pointer-item' : ''; | |
| 5432 | + | |
| 5433 | + echo '<div class="' . esc_attr($class . ' ' . ($settings['element_tax_style'] ?? '')) . '">'; | |
| 5434 | + echo '<div class="inner-block">'; | |
| 5435 | + | |
| 5436 | + $this->render_extra_text_and_icon($settings, 'before'); | |
| 5437 | + | |
| 5438 | + foreach ($terms as $term) { | |
| 5439 | + // Check if premium color styling | |
| 5440 | + $enable_custom_colors = $pointer ? Core::displaySettings($this)['tax1_custom_color_switcher'] : ''; | |
| 5441 | + if ('yes' === $enable_custom_colors) { | |
| 5442 | + $cfc_text = Grid_Ajax_Security::sanitize_css_color( | |
| 5443 | + get_term_meta($term->term_id, sanitize_key(Core::displaySettings($this)['tax1_custom_color_field_text'] ?? ''), true) | |
| 5444 | + ); | |
| 5445 | + $cfc_bg = Grid_Ajax_Security::sanitize_css_color( | |
| 5446 | + get_term_meta($term->term_id, sanitize_key(Core::displaySettings($this)['tax1_custom_color_field_bg'] ?? ''), true) | |
| 5447 | + ); | |
| 5448 | + | |
| 5449 | + if ($cfc_text || $cfc_bg) { | |
| 5450 | + $style_block = 'color:' . esc_html($cfc_text) . '; background-color:' . esc_html($cfc_bg) . '; border-color:' . esc_html($cfc_bg) . ';'; | |
| 5451 | + $css_selector = '.elementor-element' . $this->get_unique_selector() . ' .king-addons-grid-tax-style-1 .inner-block a.king-addons-tax-id-' . absint($term->term_id); | |
| 5452 | + echo '<style>' . esc_html($css_selector) . '{' . $style_block . '}</style>'; | |
| 5453 | + } | |
| 5454 | + } | |
| 5455 | + | |
| 5456 | + echo '<a class="' . esc_attr($pointer_item_class . ' king-addons-tax-id-' . $term->term_id) . '" href="' . esc_url(get_term_link($term->term_id)) . '">'; | |
| 5457 | + echo esc_html($term->name); | |
| 5458 | + if (++$count !== count($terms)) { | |
| 5459 | + echo '<span class="tax-sep">' . esc_html($settings['element_tax_sep']) . '</span>'; | |
| 5460 | + } | |
| 5461 | + echo '</a>'; | |
| 5462 | + } | |
| 5463 | + | |
| 5464 | + $this->render_extra_text_and_icon($settings, 'after'); | |
| 5465 | + | |
| 5466 | + echo '</div></div>'; | |
| 5467 | + } | |
| 5468 | + | |
| 5469 | + /** | |
| 5470 | + * Helper function to render extra text/icon before or after | |
| 5471 | + * | |
| 5472 | + * @param array $settings | |
| 5473 | + * @param string $position 'before'|'after' | |
| 5474 | + * @param bool $iconOnly Render icon only if true | |
| 5475 | + * @noinspection PhpMissingParamTypeInspection | |
| 5476 | + */ | |
| 5477 | + private function render_extra_text_and_icon($settings, $position, $iconOnly = false) | |
| 5478 | + { | |
| 5479 | + if ($iconOnly) { | |
| 5480 | + // Render icon | |
| 5481 | + if ($position === $settings['element_extra_icon_pos']) { | |
| 5482 | + ob_start(); | |
| 5483 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 5484 | + $extra_icon = ob_get_clean(); | |
| 5485 | + | |
| 5486 | + echo '<span class="king-addons-grid-extra-icon-' . esc_attr($position) . '">'; | |
| 5487 | + echo $extra_icon; | |
| 5488 | + echo '</span>'; | |
| 5489 | + } | |
| 5490 | + } else { | |
| 5491 | + // Render text | |
| 5492 | + if ($position === $settings['element_extra_text_pos']) { | |
| 5493 | + echo '<span class="king-addons-grid-extra-text-' . esc_attr($position) . '">'; | |
| 5494 | + echo esc_html($settings['element_extra_text']); | |
| 5495 | + echo '</span>'; | |
| 5496 | + } | |
| 5497 | + } | |
| 5498 | + } | |
| 5499 | + | |
| 5500 | + public function get_elements($type, $settings, $class, $post_id) | |
| 5501 | + { | |
| 5502 | + // Fallback for any pro-only items | |
| 5503 | + if (in_array($type, ['pro-lk', 'pro-shr', 'pro-cf'], true)) { | |
| 5504 | + $type = 'title'; | |
| 5505 | + } | |
| 5506 | + | |
| 5507 | + switch ($type) { | |
| 5508 | + case 'title': | |
| 5509 | + $this->render_post_title($settings, $class); | |
| 5510 | + break; | |
| 5511 | + case 'content': | |
| 5512 | + $this->render_post_content($settings, $class); | |
| 5513 | + break; | |
| 5514 | + case 'excerpt': | |
| 5515 | + $this->render_post_excerpt($settings, $class); | |
| 5516 | + break; | |
| 5517 | + case 'date': | |
| 5518 | + $this->render_post_date($settings, $class); | |
| 5519 | + break; | |
| 5520 | + case 'time': | |
| 5521 | + $this->render_post_time($settings, $class); | |
| 5522 | + break; | |
| 5523 | + case 'author': | |
| 5524 | + $this->render_post_author($settings, $class); | |
| 5525 | + break; | |
| 5526 | + case 'comments': | |
| 5527 | + $this->render_post_comments($settings, $class); | |
| 5528 | + break; | |
| 5529 | + case 'read-more': | |
| 5530 | + $this->render_post_read_more($settings, $class); | |
| 5531 | + break; | |
| 5532 | + case 'likes': | |
| 5533 | + $this->render_post_likes($settings, $class, $post_id); | |
| 5534 | + break; | |
| 5535 | + case 'sharing': | |
| 5536 | + $this->render_post_sharing_icons($settings, $class); | |
| 5537 | + break; | |
| 5538 | + case 'custom-field': | |
| 5539 | + $this->render_post_custom_field($settings, $class, $post_id); | |
| 5540 | + break; | |
| 5541 | + case 'separator': | |
| 5542 | + $this->render_post_element_separator($settings, $class); | |
| 5543 | + break; | |
| 5544 | + default: | |
| 5545 | + $this->render_post_taxonomies($settings, $class, $post_id); | |
| 5546 | + } | |
| 5547 | + } | |
| 5548 | + | |
| 5549 | + public function get_elements_by_location($location, $settings, $post_id) | |
| 5550 | + { | |
| 5551 | + $locations = []; | |
| 5552 | + | |
| 5553 | + // Build the elements array by location | |
| 5554 | + foreach ($settings['grid_elements'] as $data) { | |
| 5555 | + // Force it to 'over' in original code | |
| 5556 | + $place = 'over'; | |
| 5557 | + $align_vr = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 5558 | + ? $data['element_align_vr'] | |
| 5559 | + : 'bottom'; | |
| 5560 | + | |
| 5561 | + if (!isset($locations[$place])) { | |
| 5562 | + $locations[$place] = []; | |
| 5563 | + } | |
| 5564 | + /** @noinspection PhpConditionAlreadyCheckedInspection */ | |
| 5565 | + if ('over' === $place) { | |
| 5566 | + if (!isset($locations[$place][$align_vr])) { | |
| 5567 | + $locations[$place][$align_vr] = []; | |
| 5568 | + } | |
| 5569 | + $locations[$place][$align_vr][] = $data; | |
| 5570 | + } else { | |
| 5571 | + $locations[$place][] = $data; | |
| 5572 | + } | |
| 5573 | + } | |
| 5574 | + | |
| 5575 | + // Render elements in the correct location | |
| 5576 | + if (empty($locations[$location])) { | |
| 5577 | + return; | |
| 5578 | + } | |
| 5579 | + | |
| 5580 | + if ('over' === $location) { | |
| 5581 | + foreach ($locations[$location] as $align => $elements) { | |
| 5582 | + if ('middle' === $align) { | |
| 5583 | + echo '<div class="king-addons-cv-container"><div class="king-addons-cv-outer"><div class="king-addons-cv-inner">'; | |
| 5584 | + } | |
| 5585 | + echo '<div class="king-addons-grid-media-hover-' . esc_attr($align) . ' elementor-clearfix">'; | |
| 5586 | + foreach ($elements as $data) { | |
| 5587 | + $class = 'king-addons-grid-item-' . sanitize_html_class($data['element_select'] ?? '') . | |
| 5588 | + ' elementor-repeater-item-' . sanitize_html_class($data['_id'] ?? '') . | |
| 5589 | + ' king-addons-grid-item-display-' . sanitize_html_class($data['element_display'] ?? '') . | |
| 5590 | + ' king-addons-grid-item-align-' . sanitize_html_class($data['element_align_hr'] ?? '') . | |
| 5591 | + $this->get_animation_class($data, 'element'); | |
| 5592 | + $this->get_elements($data['element_select'], $data, $class, $post_id); | |
| 5593 | + } | |
| 5594 | + echo '</div>'; | |
| 5595 | + if ('middle' === $align) { | |
| 5596 | + echo '</div></div></div>'; | |
| 5597 | + } | |
| 5598 | + } | |
| 5599 | + } else { | |
| 5600 | + echo '<div class="king-addons-grid-item-' . esc_attr($location) . '-content elementor-clearfix">'; | |
| 5601 | + foreach ($locations[$location] as $data) { | |
| 5602 | + $class = 'king-addons-grid-item-' . sanitize_html_class($data['element_select'] ?? '') . | |
| 5603 | + ' elementor-repeater-item-' . sanitize_html_class($data['_id'] ?? '') . | |
| 5604 | + ' king-addons-grid-item-display-' . sanitize_html_class($data['element_display'] ?? '') . | |
| 5605 | + ' king-addons-grid-item-align-' . sanitize_html_class($data['element_align_hr'] ?? ''); | |
| 5606 | + $this->get_elements($data['element_select'], $data, $class, $post_id); | |
| 5607 | + } | |
| 5608 | + echo '</div>'; | |
| 5609 | + } | |
| 5610 | + } | |
| 5611 | + | |
| 5612 | + public function add_slider_settings($settings) | |
| 5613 | + { | |
| 5614 | + $slider_is_rtl = is_rtl(); | |
| 5615 | + $slider_direction = $slider_is_rtl ? 'rtl' : 'ltr'; | |
| 5616 | + | |
| 5617 | + $slider_options = [ | |
| 5618 | + 'rtl' => $slider_is_rtl, | |
| 5619 | + 'slidesToShow' => 1, | |
| 5620 | + 'infinite' => ('yes' === $settings['slider_loop']), | |
| 5621 | + 'speed' => absint($settings['slider_effect_duration'] * 1000), | |
| 5622 | + 'arrows' => true, | |
| 5623 | + 'autoplay' => ('yes' === $settings['slider_autoplay']), | |
| 5624 | + 'autoplaySpeed' => absint($settings['slider_autoplay_duration'] * 1000), | |
| 5625 | + 'pauseOnHover' => $settings['slider_pause_on_hover'], | |
| 5626 | + 'prevArrow' => '#king-addons-grid-slider-prev-' . $this->get_id(), | |
| 5627 | + 'nextArrow' => '#king-addons-grid-slider-next-' . $this->get_id(), | |
| 5628 | + ]; | |
| 5629 | + | |
| 5630 | + $this->add_render_attribute('slider-settings', [ | |
| 5631 | + 'dir' => esc_attr($slider_direction), | |
| 5632 | + 'data-slick' => wp_json_encode($slider_options), | |
| 5633 | + ]); | |
| 5634 | + } | |
| 5635 | + | |
| 5636 | + public function render_magazine_grid($settings, $slide_offset) | |
| 5637 | + { | |
| 5638 | + $posts = new WP_Query($this->get_main_query_args($slide_offset)); | |
| 5639 | + | |
| 5640 | + // Check premium fallback for layout | |
| 5641 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 5642 | + $restricted_layouts = ['1-2', '1-3', '1-4', '1-1-2', '2-1-2', '1vh-3h']; | |
| 5643 | + if (in_array($settings['king_addons_grid_layout_select'], $restricted_layouts, true)) { | |
| 5644 | + $settings['king_addons_grid_layout_select'] = '1-1-3'; | |
| 5645 | + } | |
| 5646 | + } | |
| 5647 | + | |
| 5648 | + echo '<section class="king-addons-magazine-grid king-addons-magazine-grid-add-' . esc_attr($settings['king_addons_grid_layout_select']) . | |
| 5649 | + ' king-addons-magazine-grid-add-rows-' . esc_attr($settings['layout_rows_number']) . '">'; | |
| 5650 | + | |
| 5651 | + if ($posts->have_posts()) : | |
| 5652 | + // Randomize if needed | |
| 5653 | + if ($settings['query_randomize'] === 'rand' && is_front_page() && !Core::isBlogArchive()) { | |
| 5654 | + shuffle($posts->posts); | |
| 5655 | + } | |
| 5656 | + | |
| 5657 | + while ($posts->have_posts()) : | |
| 5658 | + $posts->the_post(); | |
| 5659 | + $post_class = implode(' ', get_post_class('king-addons-magazine-grid-item elementor-clearfix', get_the_ID())); | |
| 5660 | + | |
| 5661 | + echo '<article class="' . esc_attr($post_class) . '">'; | |
| 5662 | + $this->render_password_protected_input(); | |
| 5663 | + | |
| 5664 | + echo '<div class="king-addons-grid-item-inner">'; | |
| 5665 | + echo '<div class="king-addons-grid-media-wrap" data-overlay-link="' . esc_attr($settings['overlay_post_link']) . '">'; | |
| 5666 | + | |
| 5667 | + $this->render_post_thumbnail($settings, get_the_ID()); | |
| 5668 | + | |
| 5669 | + echo '<div class="king-addons-grid-media-hover king-addons-animation-wrap">'; | |
| 5670 | + $this->render_media_overlay($settings); | |
| 5671 | + $this->get_elements_by_location('over', $settings, get_the_ID()); | |
| 5672 | + echo '</div></div></div></article>'; | |
| 5673 | + | |
| 5674 | + endwhile; | |
| 5675 | + wp_reset_postdata(); | |
| 5676 | + else: | |
| 5677 | + echo '<h2>' . esc_html($settings['query_not_found_text']) . '</h2>'; | |
| 5678 | + endif; | |
| 5679 | + | |
| 5680 | + echo '</section>'; | |
| 5681 | + } | |
| 5682 | + | |
| 5683 | + protected function render() | |
| 5684 | + { | |
| 5685 | + $settings = Core::displaySettings($this); | |
| 5686 | + $render_attribute = ''; | |
| 5687 | + | |
| 5688 | + // If no premium, reset slider options | |
| 5689 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 5690 | + $settings['slider_enable'] = ''; | |
| 5691 | + $settings['slider_effect'] = ''; | |
| 5692 | + } | |
| 5693 | + | |
| 5694 | + // Add slider settings if enabled | |
| 5695 | + if ('yes' === $settings['slider_enable']) { | |
| 5696 | + $this->add_slider_settings($settings); | |
| 5697 | + $render_attribute = $this->get_render_attribute_string('slider-settings'); | |
| 5698 | + } | |
| 5699 | + | |
| 5700 | + echo '<div class="king-addons-magazine-grid-wrap" ' . $render_attribute . | |
| 5701 | + ' data-slide-effect="' . esc_attr($settings['slider_effect']) . '">'; | |
| 5702 | + | |
| 5703 | + if ('yes' === $settings['slider_enable']) { | |
| 5704 | + for ($i = 0; $i < $settings['slider_amount']; $i++) { | |
| 5705 | + echo '<div class="king-addons-magazine-slide">'; | |
| 5706 | + $this->render_magazine_grid($settings, $i); | |
| 5707 | + echo '</div>'; | |
| 5708 | + } | |
| 5709 | + } else { | |
| 5710 | + $this->render_magazine_grid($settings, 0); | |
| 5711 | + } | |
| 5712 | + | |
| 5713 | + echo '</div>'; | |
| 5714 | + | |
| 5715 | + // Slider arrows | |
| 5716 | + if ('yes' === $settings['slider_enable']) { | |
| 5717 | + echo '<div class="king-addons-grid-slider-arrow-container">'; | |
| 5718 | + echo '<div class="king-addons-grid-slider-prev-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-prev-' . esc_html($this->get_id()) . '">'; | |
| 5719 | + echo Core::getIcon($settings['slider_nav_icon'], ''); | |
| 5720 | + echo '</div>'; | |
| 5721 | + echo '<div class="king-addons-grid-slider-next-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-next-' . esc_html($this->get_id()) . '">'; | |
| 5722 | + echo Core::getIcon($settings['slider_nav_icon'], ''); | |
| 5723 | + echo '</div>'; | |
| 5724 | + echo '</div>'; | |
| 5725 | + } | |
| 5726 | + } | |
| 5727 | +} | |