| @@ -1,0 +1,9907 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace King_Addons; | |
| 4 | + | |
| 5 | +use Elementor\Embed; | |
| 6 | +use Elementor\Widget_Base; | |
| 7 | +use Elementor\Controls_Manager; | |
| 8 | +use Elementor\Group_Control_Box_Shadow; | |
| 9 | +use Elementor\Group_Control_Text_Shadow; | |
| 10 | +use Elementor\Group_Control_Background; | |
| 11 | +use Elementor\Group_Control_Typography; | |
| 12 | +use Elementor\Icons_Manager; | |
| 13 | +use Elementor\Repeater; | |
| 14 | +use Elementor\Group_Control_Image_Size; | |
| 15 | +use Elementor\Utils; | |
| 16 | +use WP_Query; | |
| 17 | + | |
| 18 | +if (!defined('ABSPATH')) { | |
| 19 | + exit; | |
| 20 | +} | |
| 21 | + | |
| 22 | +class Posts_Grid extends Widget_Base | |
| 23 | +{ | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + public function get_name() | |
| 28 | + { | |
| 29 | + return 'king-addons-grid'; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public function get_title() | |
| 33 | + { | |
| 34 | + return esc_html__('Posts Grid & Slider', 'king-addons'); | |
| 35 | + } | |
| 36 | + | |
| 37 | + public function get_icon() | |
| 38 | + { | |
| 39 | + return 'king-addons-icon king-addons-posts-grid'; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public function get_categories() | |
| 43 | + { | |
| 44 | + return ['king-addons']; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public function get_keywords() | |
| 48 | + { | |
| 49 | + return ['king addons', 'king', 'addons', 'kingaddons', 'king-addons', 'gr', 'carousel', 'portfolio', 'loop', 'filterable', | |
| 50 | + 'blog', 'portfolio grid', 'posts', 'post grid', 'posts grid', 'filter', 'post', 'posts', 'masonry', 'grid', | |
| 51 | + 'post slider', 'posts slider', 'post carousel', 'posts carousel', 'masonry grid', 'gallery', 'slider', | |
| 52 | + 'isotope', 'post gallery', 'posts gallery', 'filterable grid', 'loop grid']; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public function get_script_depends() | |
| 56 | + { | |
| 57 | + return [ | |
| 58 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-imagesloaded-imagesloaded', | |
| 59 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-infinitescroll-infinitescroll', | |
| 60 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-isotope-kng', | |
| 61 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-slick', | |
| 62 | +// KING_ADDONS_ASSETS_UNIQUE_KEY . '-lightgallery-lightgallery', | |
| 63 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-grid-grid', | |
| 64 | + ]; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public function get_style_depends() | |
| 68 | + { | |
| 69 | + return [ | |
| 70 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-helper', | |
| 71 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-button', | |
| 72 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-general', | |
| 73 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-timing', | |
| 74 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-loading', | |
| 75 | +// KING_ADDONS_ASSETS_UNIQUE_KEY . '-lightgallery-lightgallery', | |
| 76 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-grid-grid', | |
| 77 | + KING_ADDONS_ASSETS_UNIQUE_KEY . '-general-general', | |
| 78 | + ]; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public function get_custom_help_url() | |
| 82 | + { | |
| 83 | + return 'mailto:bug@kingaddons.com?subject=Bug Report - King Addons&body=Please describe the issue'; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public function is_reload_preview_required() | |
| 87 | + { | |
| 88 | + return true; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public function has_widget_inner_wrapper(): bool | |
| 92 | + { | |
| 93 | + return true; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public function add_option_query_source() | |
| 97 | + { | |
| 98 | + $post_types = []; | |
| 99 | + $post_types['post'] = esc_html__('Posts', 'king-addons'); | |
| 100 | + $post_types['page'] = esc_html__('Pages', 'king-addons'); | |
| 101 | + | |
| 102 | + $custom_post_types = Core::getCustomTypes('post'); | |
| 103 | + foreach ($custom_post_types as $slug => $title) { | |
| 104 | + if ('product' === $slug || 'e-landing-page' === $slug) { | |
| 105 | + continue; | |
| 106 | + } | |
| 107 | + | |
| 108 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 109 | + $post_types['pro-' . substr($slug, 0, 2)] = esc_html($title) . ' (Pro)'; | |
| 110 | + } else { | |
| 111 | + $post_types[$slug] = esc_html($title); | |
| 112 | + } | |
| 113 | + } | |
| 114 | + | |
| 115 | + $post_types['current'] = esc_html__('Current Query', 'king-addons'); | |
| 116 | + $post_types['pro-rl'] = esc_html__('Related Query (Pro)', 'king-addons'); | |
| 117 | + | |
| 118 | + return $post_types; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public function get_available_taxonomies() | |
| 122 | + { | |
| 123 | + $post_taxonomies = []; | |
| 124 | + $post_taxonomies['category'] = esc_html__('Categories', 'king-addons'); | |
| 125 | + $post_taxonomies['post_tag'] = esc_html__('Tags', 'king-addons'); | |
| 126 | + | |
| 127 | + $custom_post_taxonomies = Core::getCustomTypes('tax'); | |
| 128 | + foreach ($custom_post_taxonomies as $slug => $title) { | |
| 129 | + if ('product_tag' === $slug || 'product_cat' === $slug) { | |
| 130 | + continue; | |
| 131 | + } | |
| 132 | + | |
| 133 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 134 | + $post_taxonomies['pro-' . substr($slug, 0, 2)] = esc_html($title) . ' (Pro)'; | |
| 135 | + } else { | |
| 136 | + $post_taxonomies[$slug] = esc_html($title); | |
| 137 | + } | |
| 138 | + } | |
| 139 | + | |
| 140 | + return $post_taxonomies; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public function add_control_secondary_img_on_hover() | |
| 144 | + { | |
| 145 | + $this->add_control( | |
| 146 | + 'secondary_img_on_hover', | |
| 147 | + [ | |
| 148 | + 'label' => sprintf(__('Secondary Image on Hover %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 149 | + 'type' => Controls_Manager::SWITCHER, | |
| 150 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 151 | + ] | |
| 152 | + ); | |
| 153 | + } | |
| 154 | + | |
| 155 | + public function add_control_open_links_in_new_tab() | |
| 156 | + { | |
| 157 | + $this->add_control( | |
| 158 | + 'open_links_in_new_tab', | |
| 159 | + [ | |
| 160 | + 'label' => sprintf(__('Open Links in New Tab %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 161 | + 'type' => Controls_Manager::SWITCHER, | |
| 162 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 163 | + ] | |
| 164 | + ); | |
| 165 | + } | |
| 166 | + | |
| 167 | + public function add_control_grid_lazy_loading() | |
| 168 | + { | |
| 169 | + $this->add_control( | |
| 170 | + 'grid_lazy_loading', | |
| 171 | + [ | |
| 172 | + 'label' => sprintf(__('Lazy Loading %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 173 | + 'type' => Controls_Manager::SWITCHER, | |
| 174 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 175 | + ] | |
| 176 | + ); | |
| 177 | + } | |
| 178 | + | |
| 179 | + public function add_control_display_scheduled_posts() | |
| 180 | + { | |
| 181 | + $this->add_control( | |
| 182 | + 'display_scheduled_posts', | |
| 183 | + [ | |
| 184 | + 'label' => sprintf(__('Display Only Scheduled %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 185 | + 'type' => Controls_Manager::SWITCHER, | |
| 186 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 187 | + ] | |
| 188 | + ); | |
| 189 | + } | |
| 190 | + | |
| 191 | + public function add_control_query_randomize() | |
| 192 | + { | |
| 193 | + $this->add_control( | |
| 194 | + 'query_randomize', | |
| 195 | + [ | |
| 196 | + 'label' => sprintf(__('Randomize Query %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 197 | + 'type' => Controls_Manager::SWITCHER, | |
| 198 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 199 | + ] | |
| 200 | + ); | |
| 201 | + } | |
| 202 | + | |
| 203 | + public function add_control_order_posts() | |
| 204 | + { | |
| 205 | + $this->add_control( | |
| 206 | + 'order_posts', | |
| 207 | + [ | |
| 208 | + 'label' => esc_html__('Order By', 'king-addons'), | |
| 209 | + 'type' => Controls_Manager::SELECT, | |
| 210 | + 'default' => 'date', | |
| 211 | + 'label_block' => false, | |
| 212 | + 'options' => [ | |
| 213 | + 'date' => esc_html__('Date', 'king-addons'), | |
| 214 | + 'pro-tl' => esc_html__('Title (Pro)', 'king-addons'), | |
| 215 | + 'pro-mf' => esc_html__('Last Modified (Pro)', 'king-addons'), | |
| 216 | + 'pro-d' => esc_html__('Post ID (Pro)', 'king-addons'), | |
| 217 | + 'pro-ar' => esc_html__('Post Author (Pro)', 'king-addons'), | |
| 218 | + 'pro-cc' => esc_html__('Comment Count (Pro)', 'king-addons'), | |
| 219 | + 'pro-mv' => esc_html__('Custom Field (Pro)', 'king-addons') | |
| 220 | + ], | |
| 221 | + 'condition' => [ | |
| 222 | + 'query_randomize!' => 'rand', | |
| 223 | + ] | |
| 224 | + ] | |
| 225 | + ); | |
| 226 | + } | |
| 227 | + | |
| 228 | + public function add_control_order_posts_by_acf($meta) | |
| 229 | + { | |
| 230 | + } | |
| 231 | + | |
| 232 | + public function add_control_query_slides_to_show() | |
| 233 | + { | |
| 234 | + $this->add_control( | |
| 235 | + 'query_slides_to_show', | |
| 236 | + [ | |
| 237 | + 'label' => esc_html__('Slides to Show', 'king-addons'), | |
| 238 | + 'type' => Controls_Manager::NUMBER, | |
| 239 | + 'default' => 4, | |
| 240 | + 'min' => 0, | |
| 241 | + 'max' => 4, | |
| 242 | + 'condition' => [ | |
| 243 | + 'layout_select' => 'slider', | |
| 244 | + ], | |
| 245 | + ] | |
| 246 | + ); | |
| 247 | + } | |
| 248 | + | |
| 249 | + public function add_control_layout_select() | |
| 250 | + { | |
| 251 | + $this->add_control( | |
| 252 | + 'layout_select', | |
| 253 | + [ | |
| 254 | + 'label' => esc_html__('Select Layout', 'king-addons'), | |
| 255 | + 'type' => Controls_Manager::SELECT, | |
| 256 | + 'default' => 'fitRows', | |
| 257 | + 'options' => [ | |
| 258 | + 'fitRows' => esc_html__('FitRows - Equal Height', 'king-addons'), | |
| 259 | + 'list' => esc_html__('List Style', 'king-addons'), | |
| 260 | + 'slider' => esc_html__('Slider / Carousel', 'king-addons'), | |
| 261 | + 'pro-ms' => esc_html__('Masonry - Unlimited Height (Pro)', 'king-addons'), | |
| 262 | + ], | |
| 263 | + 'render_type' => 'template' | |
| 264 | + ] | |
| 265 | + ); | |
| 266 | + } | |
| 267 | + | |
| 268 | + public function add_control_layout_columns() | |
| 269 | + { | |
| 270 | + $this->add_responsive_control( | |
| 271 | + 'layout_columns', | |
| 272 | + [ | |
| 273 | + 'label' => esc_html__('Columns', 'king-addons'), | |
| 274 | + 'type' => Controls_Manager::SELECT, | |
| 275 | + 'default' => 3, | |
| 276 | + 'widescreen_default' => 3, | |
| 277 | + 'laptop_default' => 3, | |
| 278 | + 'tablet_extra_default' => 3, | |
| 279 | + 'tablet_default' => 2, | |
| 280 | + 'mobile_extra_default' => 2, | |
| 281 | + 'mobile_default' => 1, | |
| 282 | + 'options' => [ | |
| 283 | + 1 => esc_html__('One', 'king-addons'), | |
| 284 | + 2 => esc_html__('Two', 'king-addons'), | |
| 285 | + 3 => esc_html__('Three', 'king-addons'), | |
| 286 | + 'pro-4' => esc_html__('Four (Pro)', 'king-addons'), | |
| 287 | + 'pro-5' => esc_html__('Five (Pro)', 'king-addons'), | |
| 288 | + 'pro-6' => esc_html__('Six (Pro)', 'king-addons'), | |
| 289 | + ], | |
| 290 | + 'prefix_class' => 'king-addons-grid-columns-%s', | |
| 291 | + 'render_type' => 'template', | |
| 292 | + 'separator' => 'before', | |
| 293 | + 'condition' => [ | |
| 294 | + 'layout_select' => ['fitRows', 'masonry', 'list'], | |
| 295 | + ] | |
| 296 | + ] | |
| 297 | + ); | |
| 298 | + } | |
| 299 | + | |
| 300 | + public function add_control_layout_animation() | |
| 301 | + { | |
| 302 | + $this->add_control( | |
| 303 | + 'layout_animation', | |
| 304 | + [ | |
| 305 | + 'label' => esc_html__('Select Animation', 'king-addons'), | |
| 306 | + 'type' => Controls_Manager::SELECT, | |
| 307 | + 'default' => 'default', | |
| 308 | + 'options' => [ | |
| 309 | + 'default' => esc_html__('None', 'king-addons'), | |
| 310 | + 'zoom' => esc_html__('Zoom', 'king-addons'), | |
| 311 | + 'pro-fd' => esc_html__('Fade (Pro)', 'king-addons'), | |
| 312 | + 'pro-fs' => esc_html__('Fade + SlideUp (Pro)', 'king-addons'), | |
| 313 | + ], | |
| 314 | + 'selectors_dictionary' => [ | |
| 315 | + 'default' => '', | |
| 316 | + 'zoom' => 'opacity: 0; transform: scale(0.01)', | |
| 317 | + ], | |
| 318 | + 'selectors' => [ | |
| 319 | + '{{WRAPPER}} .king-addons-grid-item-inner' => '{{VALUE}}', | |
| 320 | + ], | |
| 321 | + 'render_type' => 'template', | |
| 322 | + 'separator' => 'before', | |
| 323 | + 'condition' => [ | |
| 324 | + 'layout_select!' => 'slider', | |
| 325 | + ] | |
| 326 | + ] | |
| 327 | + ); | |
| 328 | + } | |
| 329 | + | |
| 330 | + public function add_control_layout_slider_amount() | |
| 331 | + { | |
| 332 | + $this->add_responsive_control( | |
| 333 | + 'layout_slider_amount', | |
| 334 | + [ | |
| 335 | + 'label' => esc_html__('Columns (Carousel)', 'king-addons'), | |
| 336 | + 'type' => Controls_Manager::SELECT, | |
| 337 | + 'label_block' => false, | |
| 338 | + 'default' => 2, | |
| 339 | + 'widescreen_default' => 2, | |
| 340 | + 'laptop_default' => 2, | |
| 341 | + 'tablet_extra_default' => 2, | |
| 342 | + 'tablet_default' => 2, | |
| 343 | + 'mobile_extra_default' => 2, | |
| 344 | + 'mobile_default' => 1, | |
| 345 | + 'options' => [ | |
| 346 | + 1 => esc_html__('One', 'king-addons'), | |
| 347 | + 2 => esc_html__('Two', 'king-addons'), | |
| 348 | + 'pro-3' => esc_html__('Three (Pro)', 'king-addons'), | |
| 349 | + 'pro-4' => esc_html__('Four (Pro)', 'king-addons'), | |
| 350 | + 'pro-5' => esc_html__('Five (Pro)', 'king-addons'), | |
| 351 | + 'pro-6' => esc_html__('Six (Pro)', 'king-addons'), | |
| 352 | + ], | |
| 353 | + 'prefix_class' => 'king-addons-grid-slider-columns-%s', | |
| 354 | + 'render_type' => 'template', | |
| 355 | + 'frontend_available' => true, | |
| 356 | + 'separator' => 'before', | |
| 357 | + 'condition' => [ | |
| 358 | + 'layout_select' => 'slider', | |
| 359 | + ], | |
| 360 | + ] | |
| 361 | + ); | |
| 362 | + } | |
| 363 | + | |
| 364 | + public function add_control_layout_slider_nav_hover() | |
| 365 | + { | |
| 366 | + $this->add_control( | |
| 367 | + 'layout_slider_nav_hover', | |
| 368 | + [ | |
| 369 | + 'label' => sprintf(__('Show on Hover %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 370 | + 'type' => Controls_Manager::SWITCHER, | |
| 371 | + 'classes' => 'king-addons-pro-control no-distance', | |
| 372 | + 'condition' => [ | |
| 373 | + 'layout_slider_nav' => 'yes', | |
| 374 | + 'layout_select' => 'slider', | |
| 375 | + | |
| 376 | + ], | |
| 377 | + ] | |
| 378 | + ); | |
| 379 | + } | |
| 380 | + | |
| 381 | + public function add_control_layout_slider_dots_position() | |
| 382 | + { | |
| 383 | + $this->add_control( | |
| 384 | + 'layout_slider_dots_position', | |
| 385 | + [ | |
| 386 | + 'label' => esc_html__('Pagination Layout', 'king-addons'), | |
| 387 | + 'type' => Controls_Manager::SELECT, | |
| 388 | + 'default' => 'horizontal', | |
| 389 | + 'options' => [ | |
| 390 | + 'horizontal' => esc_html__('Horizontal', 'king-addons'), | |
| 391 | + 'pro-vr' => esc_html__('Vertical (Pro)', 'king-addons'), | |
| 392 | + ], | |
| 393 | + 'prefix_class' => 'king-addons-grid-slider-dots-', | |
| 394 | + 'render_type' => 'template', | |
| 395 | + 'condition' => [ | |
| 396 | + 'layout_slider_dots' => 'yes', | |
| 397 | + 'layout_select' => 'slider', | |
| 398 | + ], | |
| 399 | + ] | |
| 400 | + ); | |
| 401 | + } | |
| 402 | + | |
| 403 | + public function add_control_layout_slider_autoplay() | |
| 404 | + { | |
| 405 | + $this->add_control( | |
| 406 | + 'layout_slider_autoplay', | |
| 407 | + [ | |
| 408 | + 'label' => sprintf(__('Autoplay %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 409 | + 'type' => Controls_Manager::SWITCHER, | |
| 410 | + 'classes' => 'king-addons-pro-control', | |
| 411 | + 'separator' => 'before', | |
| 412 | + 'condition' => [ | |
| 413 | + 'layout_select' => 'slider', | |
| 414 | + ], | |
| 415 | + ] | |
| 416 | + ); | |
| 417 | + } | |
| 418 | + | |
| 419 | + public function add_controls_group_layout_slider_autoplay() | |
| 420 | + { | |
| 421 | + } | |
| 422 | + | |
| 423 | + public function add_option_element_select() | |
| 424 | + { | |
| 425 | + return [ | |
| 426 | + 'title' => esc_html__('Title', 'king-addons'), | |
| 427 | + 'content' => esc_html__('Content', 'king-addons'), | |
| 428 | + 'excerpt' => esc_html__('Excerpt', 'king-addons'), | |
| 429 | + 'date' => esc_html__('Date', 'king-addons'), | |
| 430 | + 'time' => esc_html__('Time', 'king-addons'), | |
| 431 | + 'author' => esc_html__('Author', 'king-addons'), | |
| 432 | + 'comments' => esc_html__('Comments', 'king-addons'), | |
| 433 | + 'read-more' => esc_html__('Read More', 'king-addons'), | |
| 434 | +// TODO: Lightbox | |
| 435 | +// 'lightbox' => esc_html__('Lightbox', 'king-addons'), | |
| 436 | + 'separator' => esc_html__('Separator', 'king-addons'), | |
| 437 | + 'pro-lk' => esc_html__('Likes (Pro)', 'king-addons'), | |
| 438 | + 'pro-shr' => esc_html__('Sharing (Pro)', 'king-addons'), | |
| 439 | + 'pro-cf' => esc_html__('Custom Field (Pro)', 'king-addons'), | |
| 440 | + ]; | |
| 441 | + } | |
| 442 | + | |
| 443 | + public function add_repeater_args_element_like_icon() | |
| 444 | + { | |
| 445 | + return [ | |
| 446 | + 'type' => Controls_Manager::HIDDEN, | |
| 447 | + 'default' => '' | |
| 448 | + ]; | |
| 449 | + } | |
| 450 | + | |
| 451 | + public function add_repeater_args_element_like_text() | |
| 452 | + { | |
| 453 | + return [ | |
| 454 | + 'type' => Controls_Manager::HIDDEN, | |
| 455 | + 'default' => '' | |
| 456 | + ]; | |
| 457 | + } | |
| 458 | + | |
| 459 | + public function add_repeater_args_element_like_show_count() | |
| 460 | + { | |
| 461 | + return [ | |
| 462 | + 'type' => Controls_Manager::HIDDEN, | |
| 463 | + 'default' => '' | |
| 464 | + ]; | |
| 465 | + } | |
| 466 | + | |
| 467 | + public function add_repeater_args_element_sharing_icon_1() | |
| 468 | + { | |
| 469 | + return [ | |
| 470 | + 'type' => Controls_Manager::HIDDEN, | |
| 471 | + 'default' => '' | |
| 472 | + ]; | |
| 473 | + } | |
| 474 | + | |
| 475 | + public function add_repeater_args_element_sharing_icon_2() | |
| 476 | + { | |
| 477 | + return [ | |
| 478 | + 'type' => Controls_Manager::HIDDEN, | |
| 479 | + 'default' => '' | |
| 480 | + ]; | |
| 481 | + } | |
| 482 | + | |
| 483 | + public function add_repeater_args_element_sharing_icon_3() | |
| 484 | + { | |
| 485 | + return [ | |
| 486 | + 'type' => Controls_Manager::HIDDEN, | |
| 487 | + 'default' => '' | |
| 488 | + ]; | |
| 489 | + } | |
| 490 | + | |
| 491 | + public function add_repeater_args_element_sharing_icon_4() | |
| 492 | + { | |
| 493 | + return [ | |
| 494 | + 'type' => Controls_Manager::HIDDEN, | |
| 495 | + 'default' => '' | |
| 496 | + ]; | |
| 497 | + } | |
| 498 | + | |
| 499 | + public function add_repeater_args_element_sharing_icon_5() | |
| 500 | + { | |
| 501 | + return [ | |
| 502 | + 'type' => Controls_Manager::HIDDEN, | |
| 503 | + 'default' => '' | |
| 504 | + ]; | |
| 505 | + } | |
| 506 | + | |
| 507 | + public function add_repeater_args_element_sharing_icon_6() | |
| 508 | + { | |
| 509 | + return [ | |
| 510 | + 'type' => Controls_Manager::HIDDEN, | |
| 511 | + 'default' => '' | |
| 512 | + ]; | |
| 513 | + } | |
| 514 | + | |
| 515 | + public function add_repeater_args_element_sharing_trigger() | |
| 516 | + { | |
| 517 | + return [ | |
| 518 | + 'type' => Controls_Manager::HIDDEN, | |
| 519 | + 'default' => '' | |
| 520 | + ]; | |
| 521 | + } | |
| 522 | + | |
| 523 | + public function add_repeater_args_element_sharing_trigger_icon() | |
| 524 | + { | |
| 525 | + return [ | |
| 526 | + 'type' => Controls_Manager::HIDDEN, | |
| 527 | + 'default' => '' | |
| 528 | + ]; | |
| 529 | + } | |
| 530 | + | |
| 531 | + public function add_repeater_args_element_sharing_trigger_action() | |
| 532 | + { | |
| 533 | + return [ | |
| 534 | + 'type' => Controls_Manager::HIDDEN, | |
| 535 | + 'default' => '' | |
| 536 | + ]; | |
| 537 | + } | |
| 538 | + | |
| 539 | + public function add_repeater_args_element_sharing_trigger_direction() | |
| 540 | + { | |
| 541 | + return [ | |
| 542 | + 'type' => Controls_Manager::HIDDEN, | |
| 543 | + 'default' => '' | |
| 544 | + ]; | |
| 545 | + } | |
| 546 | + | |
| 547 | + public function add_repeater_args_element_sharing_tooltip() | |
| 548 | + { | |
| 549 | + return [ | |
| 550 | + 'type' => Controls_Manager::HIDDEN, | |
| 551 | + 'default' => '' | |
| 552 | + ]; | |
| 553 | + } | |
| 554 | + | |
| 555 | + public function add_repeater_args_element_custom_field() | |
| 556 | + { | |
| 557 | + return [ | |
| 558 | + 'type' => Controls_Manager::HIDDEN, | |
| 559 | + 'default' => '' | |
| 560 | + ]; | |
| 561 | + } | |
| 562 | + | |
| 563 | + public function add_repeater_args_element_custom_field_img_ID() | |
| 564 | + { | |
| 565 | + return [ | |
| 566 | + 'type' => Controls_Manager::HIDDEN, | |
| 567 | + 'default' => '' | |
| 568 | + ]; | |
| 569 | + } | |
| 570 | + | |
| 571 | + public function add_repeater_args_element_custom_field_btn_link() | |
| 572 | + { | |
| 573 | + return [ | |
| 574 | + 'type' => Controls_Manager::HIDDEN, | |
| 575 | + 'default' => '' | |
| 576 | + ]; | |
| 577 | + } | |
| 578 | + | |
| 579 | + public function add_repeater_args_element_custom_field_new_tab() | |
| 580 | + { | |
| 581 | + return [ | |
| 582 | + 'type' => Controls_Manager::HIDDEN, | |
| 583 | + 'default' => '' | |
| 584 | + ]; | |
| 585 | + } | |
| 586 | + | |
| 587 | + public function add_repeater_args_custom_field_wrapper_html_divider1() | |
| 588 | + { | |
| 589 | + return [ | |
| 590 | + 'type' => Controls_Manager::HIDDEN, | |
| 591 | + 'default' => '' | |
| 592 | + ]; | |
| 593 | + } | |
| 594 | + | |
| 595 | + public function add_repeater_args_element_custom_field_wrapper() | |
| 596 | + { | |
| 597 | + return [ | |
| 598 | + 'type' => Controls_Manager::HIDDEN, | |
| 599 | + 'default' => '' | |
| 600 | + ]; | |
| 601 | + } | |
| 602 | + | |
| 603 | + public function add_repeater_args_element_custom_field_wrapper_html() | |
| 604 | + { | |
| 605 | + return [ | |
| 606 | + 'type' => Controls_Manager::HIDDEN, | |
| 607 | + 'default' => '' | |
| 608 | + ]; | |
| 609 | + } | |
| 610 | + | |
| 611 | + public function add_repeater_args_custom_field_wrapper_html_divider2() | |
| 612 | + { | |
| 613 | + return [ | |
| 614 | + 'type' => Controls_Manager::HIDDEN, | |
| 615 | + 'default' => '' | |
| 616 | + ]; | |
| 617 | + } | |
| 618 | + | |
| 619 | + public function add_repeater_args_element_cf_tag() | |
| 620 | + { | |
| 621 | + return [ | |
| 622 | + 'type' => Controls_Manager::HIDDEN, | |
| 623 | + 'default' => '' | |
| 624 | + ]; | |
| 625 | + } | |
| 626 | + | |
| 627 | + public function add_repeater_args_element_custom_field_style() | |
| 628 | + { | |
| 629 | + return [ | |
| 630 | + 'type' => Controls_Manager::HIDDEN, | |
| 631 | + 'default' => '' | |
| 632 | + ]; | |
| 633 | + } | |
| 634 | + | |
| 635 | + public function add_repeater_args_element_trim_text_by() | |
| 636 | + { | |
| 637 | + return [ | |
| 638 | + 'word_count' => esc_html__('Word Count', 'king-addons'), | |
| 639 | + 'pro-lc' => esc_html__('Letter Count (Pro)', 'king-addons') | |
| 640 | + ]; | |
| 641 | + } | |
| 642 | + | |
| 643 | + public function add_control_overlay_animation_divider() | |
| 644 | + { | |
| 645 | + } | |
| 646 | + | |
| 647 | + public function add_control_overlay_image() | |
| 648 | + { | |
| 649 | + } | |
| 650 | + | |
| 651 | + public function add_control_overlay_image_width() | |
| 652 | + { | |
| 653 | + } | |
| 654 | + | |
| 655 | + public function add_control_image_effects() | |
| 656 | + { | |
| 657 | + $this->add_control( | |
| 658 | + 'image_effects', | |
| 659 | + [ | |
| 660 | + 'label' => esc_html__('Select Effect', 'king-addons'), | |
| 661 | + 'type' => Controls_Manager::SELECT, | |
| 662 | + 'options' => [ | |
| 663 | + 'none' => esc_html__('None', 'king-addons'), | |
| 664 | + 'pro-zi' => esc_html__('Zoom In (Pro)', 'king-addons'), | |
| 665 | + 'pro-zo' => esc_html__('Zoom Out (Pro)', 'king-addons'), | |
| 666 | + 'grayscale-in' => esc_html__('Grayscale In', 'king-addons'), | |
| 667 | + 'pro-go' => esc_html__('Grayscale Out (Pro)', 'king-addons'), | |
| 668 | + 'blur-in' => esc_html__('Blur In', 'king-addons'), | |
| 669 | + 'pro-bo' => esc_html__('Blur Out (Pro)', 'king-addons'), | |
| 670 | + 'slide' => esc_html__('Slide', 'king-addons'), | |
| 671 | + ], | |
| 672 | + 'default' => 'none', | |
| 673 | + ] | |
| 674 | + ); | |
| 675 | + } | |
| 676 | + | |
| 677 | + /** @noinspection PhpUnused */ | |
| 678 | + public function add_section_general_lightbox() { | |
| 679 | + $this->start_controls_section( | |
| 680 | + 'section_lightbox_popup', | |
| 681 | + [ | |
| 682 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Lightbox Popup', 'king-addons'), | |
| 683 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 684 | + ] | |
| 685 | + ); | |
| 686 | + | |
| 687 | + $this->add_control( | |
| 688 | + 'lightbox_popup_autoplay', | |
| 689 | + [ | |
| 690 | + 'label' => esc_html__('Autoplay Slides', 'king-addons'), | |
| 691 | + 'type' => Controls_Manager::SWITCHER, | |
| 692 | + 'default' => 'true', | |
| 693 | + 'return_value' => 'true', | |
| 694 | + ] | |
| 695 | + ); | |
| 696 | + | |
| 697 | + $this->add_control( | |
| 698 | + 'lightbox_popup_progressbar', | |
| 699 | + [ | |
| 700 | + 'label' => esc_html__('Show Progress Bar', 'king-addons'), | |
| 701 | + 'type' => Controls_Manager::SWITCHER, | |
| 702 | + 'default' => 'true', | |
| 703 | + 'return_value' => 'true', | |
| 704 | + 'condition' => [ | |
| 705 | + 'lightbox_popup_autoplay' => 'true' | |
| 706 | + ] | |
| 707 | + ] | |
| 708 | + ); | |
| 709 | + | |
| 710 | + $this->add_control( | |
| 711 | + 'lightbox_popup_pause', | |
| 712 | + [ | |
| 713 | + 'label' => esc_html__('Autoplay Speed', 'king-addons'), | |
| 714 | + 'type' => Controls_Manager::NUMBER, | |
| 715 | + 'default' => 5, | |
| 716 | + 'min' => 1, | |
| 717 | + 'max' => 10, | |
| 718 | + 'step' => 1, | |
| 719 | + 'condition' => [ | |
| 720 | + 'lightbox_popup_autoplay' => 'true', | |
| 721 | + ], | |
| 722 | + ] | |
| 723 | + ); | |
| 724 | + | |
| 725 | + $this->add_control( | |
| 726 | + 'lightbox_popup_counter', | |
| 727 | + [ | |
| 728 | + 'label' => esc_html__('Show Counter', 'king-addons'), | |
| 729 | + 'type' => Controls_Manager::SWITCHER, | |
| 730 | + 'default' => 'true', | |
| 731 | + 'return_value' => 'true', | |
| 732 | + ] | |
| 733 | + ); | |
| 734 | + | |
| 735 | + $this->add_control( | |
| 736 | + 'lightbox_popup_arrows', | |
| 737 | + [ | |
| 738 | + 'label' => esc_html__('Show Arrows', 'king-addons'), | |
| 739 | + 'type' => Controls_Manager::SWITCHER, | |
| 740 | + 'default' => 'true', | |
| 741 | + 'return_value' => 'true', | |
| 742 | + ] | |
| 743 | + ); | |
| 744 | + | |
| 745 | + $this->add_control( | |
| 746 | + 'lightbox_popup_captions', | |
| 747 | + [ | |
| 748 | + 'label' => esc_html__('Show Captions', 'king-addons'), | |
| 749 | + 'type' => Controls_Manager::SWITCHER, | |
| 750 | + 'default' => 'true', | |
| 751 | + 'return_value' => 'true', | |
| 752 | + ] | |
| 753 | + ); | |
| 754 | + | |
| 755 | + $this->add_control_lightbox_popup_thumbnails(); | |
| 756 | + | |
| 757 | + $this->add_control_lightbox_popup_thumbnails_default(); | |
| 758 | + | |
| 759 | + $this->add_control_lightbox_popup_sharing(); | |
| 760 | + | |
| 761 | + $this->add_control( | |
| 762 | + 'lightbox_popup_zoom', | |
| 763 | + [ | |
| 764 | + 'label' => esc_html__('Show Zoom Button', 'king-addons'), | |
| 765 | + 'type' => Controls_Manager::SWITCHER, | |
| 766 | + 'default' => 'true', | |
| 767 | + 'return_value' => 'true', | |
| 768 | + ] | |
| 769 | + ); | |
| 770 | + | |
| 771 | + $this->add_control( | |
| 772 | + 'lightbox_popup_fullscreen', | |
| 773 | + [ | |
| 774 | + 'label' => esc_html__('Show Full Screen Button', 'king-addons'), | |
| 775 | + 'type' => Controls_Manager::SWITCHER, | |
| 776 | + 'default' => 'true', | |
| 777 | + 'return_value' => 'true', | |
| 778 | + ] | |
| 779 | + ); | |
| 780 | + | |
| 781 | + $this->add_control( | |
| 782 | + 'lightbox_popup_download', | |
| 783 | + [ | |
| 784 | + 'label' => esc_html__('Show Download Button', 'king-addons'), | |
| 785 | + 'type' => Controls_Manager::SWITCHER, | |
| 786 | + 'default' => 'true', | |
| 787 | + 'return_value' => 'true', | |
| 788 | + ] | |
| 789 | + ); | |
| 790 | + | |
| 791 | + $this->add_control( | |
| 792 | + 'lightbox_popup_description', | |
| 793 | + [ | |
| 794 | + 'raw' => sprintf(__('You can change Lightbox Popup styling options globally. Navigate to <strong>Dashboard > %s > Settings</strong>.', 'king-addons'), Core::getPluginName()), | |
| 795 | + 'type' => Controls_Manager::RAW_HTML, | |
| 796 | + 'separator' => 'before', | |
| 797 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', | |
| 798 | + ] | |
| 799 | + ); | |
| 800 | + | |
| 801 | + $this->end_controls_section(); | |
| 802 | + } | |
| 803 | + | |
| 804 | + /** @noinspection PhpUnused */ | |
| 805 | + public function add_section_style_lightbox() { | |
| 806 | + $this->start_controls_section( | |
| 807 | + 'section_style_lightbox', | |
| 808 | + [ | |
| 809 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Lightbox', 'king-addons'), | |
| 810 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 811 | + 'show_label' => false, | |
| 812 | + ] | |
| 813 | + ); | |
| 814 | + | |
| 815 | + $this->start_controls_tabs('tabs_grid_lightbox_style'); | |
| 816 | + | |
| 817 | + $this->start_controls_tab( | |
| 818 | + 'tab_grid_lightbox_normal', | |
| 819 | + [ | |
| 820 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 821 | + ] | |
| 822 | + ); | |
| 823 | + | |
| 824 | + $this->add_control( | |
| 825 | + 'lightbox_color', | |
| 826 | + [ | |
| 827 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 828 | + 'type' => Controls_Manager::COLOR, | |
| 829 | + 'default' => '#ffffff', | |
| 830 | + 'selectors' => [ | |
| 831 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'color: {{VALUE}}', | |
| 832 | + ], | |
| 833 | + ] | |
| 834 | + ); | |
| 835 | + | |
| 836 | + $this->add_control( | |
| 837 | + 'lightbox_bg_color', | |
| 838 | + [ | |
| 839 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 840 | + 'type' => Controls_Manager::COLOR, | |
| 841 | + 'selectors' => [ | |
| 842 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'background-color: {{VALUE}}', | |
| 843 | + ] | |
| 844 | + ] | |
| 845 | + ); | |
| 846 | + | |
| 847 | + $this->add_control( | |
| 848 | + 'lightbox_border_color', | |
| 849 | + [ | |
| 850 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 851 | + 'type' => Controls_Manager::COLOR, | |
| 852 | + 'default' => '#E8E8E8', | |
| 853 | + 'selectors' => [ | |
| 854 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-color: {{VALUE}}', | |
| 855 | + ], | |
| 856 | + ] | |
| 857 | + ); | |
| 858 | + | |
| 859 | + $this->add_group_control( | |
| 860 | + Group_Control_Text_Shadow::get_type(), | |
| 861 | + [ | |
| 862 | + 'name' => 'lightbox_shadow', | |
| 863 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-lightbox i', | |
| 864 | + ] | |
| 865 | + ); | |
| 866 | + | |
| 867 | + $this->end_controls_tab(); | |
| 868 | + | |
| 869 | + $this->start_controls_tab( | |
| 870 | + 'tab_grid_lightbox_hover', | |
| 871 | + [ | |
| 872 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 873 | + ] | |
| 874 | + ); | |
| 875 | + | |
| 876 | + $this->add_control( | |
| 877 | + 'lightbox_color_hr', | |
| 878 | + [ | |
| 879 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 880 | + 'type' => Controls_Manager::COLOR, | |
| 881 | + 'default' => '#5B03FF', | |
| 882 | + 'selectors' => [ | |
| 883 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span:hover' => 'color: {{VALUE}}', | |
| 884 | + ], | |
| 885 | + ] | |
| 886 | + ); | |
| 887 | + | |
| 888 | + $this->add_control( | |
| 889 | + 'lightbox_bg_color_hr', | |
| 890 | + [ | |
| 891 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 892 | + 'type' => Controls_Manager::COLOR, | |
| 893 | + 'selectors' => [ | |
| 894 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span:hover' => 'background-color: {{VALUE}}', | |
| 895 | + ] | |
| 896 | + ] | |
| 897 | + ); | |
| 898 | + | |
| 899 | + $this->add_control( | |
| 900 | + 'lightbox_border_color_hr', | |
| 901 | + [ | |
| 902 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 903 | + 'type' => Controls_Manager::COLOR, | |
| 904 | + 'default' => '#E8E8E8', | |
| 905 | + 'selectors' => [ | |
| 906 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span:hover' => 'border-color: {{VALUE}}', | |
| 907 | + ], | |
| 908 | + 'separator' => 'after', | |
| 909 | + ] | |
| 910 | + ); | |
| 911 | + | |
| 912 | + $this->end_controls_tab(); | |
| 913 | + | |
| 914 | + $this->end_controls_tabs(); | |
| 915 | + | |
| 916 | + $this->add_control( | |
| 917 | + 'lightbox_shadow_divider', | |
| 918 | + [ | |
| 919 | + 'type' => Controls_Manager::DIVIDER, | |
| 920 | + 'style' => 'thick', | |
| 921 | + ] | |
| 922 | + ); | |
| 923 | + | |
| 924 | + $this->add_control( | |
| 925 | + 'lightbox_transition_duration', | |
| 926 | + [ | |
| 927 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 928 | + 'type' => Controls_Manager::NUMBER, | |
| 929 | + 'default' => 0.1, | |
| 930 | + 'min' => 0, | |
| 931 | + 'max' => 5, | |
| 932 | + 'step' => 0.1, | |
| 933 | + 'selectors' => [ | |
| 934 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'transition-duration: {{VALUE}}s', | |
| 935 | + ], | |
| 936 | + 'separator' => 'after', | |
| 937 | + ] | |
| 938 | + ); | |
| 939 | + | |
| 940 | + $this->add_group_control( | |
| 941 | + Group_Control_Typography::get_type(), | |
| 942 | + [ | |
| 943 | + 'name' => 'lightbox_typography', | |
| 944 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-lightbox' | |
| 945 | + ] | |
| 946 | + ); | |
| 947 | + | |
| 948 | + $this->add_control( | |
| 949 | + 'lightbox_border_type', | |
| 950 | + [ | |
| 951 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 952 | + 'type' => Controls_Manager::SELECT, | |
| 953 | + 'options' => [ | |
| 954 | + 'none' => esc_html__('None', 'king-addons'), | |
| 955 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 956 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 957 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 958 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 959 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 960 | + ], | |
| 961 | + 'default' => 'none', | |
| 962 | + 'selectors' => [ | |
| 963 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-style: {{VALUE}};', | |
| 964 | + ], | |
| 965 | + 'render_type' => 'template', | |
| 966 | + 'separator' => 'before', | |
| 967 | + ] | |
| 968 | + ); | |
| 969 | + | |
| 970 | + $this->add_control( | |
| 971 | + 'lightbox_border_width', | |
| 972 | + [ | |
| 973 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 974 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 975 | + 'size_units' => ['px'], | |
| 976 | + 'default' => [ | |
| 977 | + 'top' => 1, | |
| 978 | + 'right' => 1, | |
| 979 | + 'bottom' => 1, | |
| 980 | + 'left' => 1, | |
| 981 | + ], | |
| 982 | + 'selectors' => [ | |
| 983 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 984 | + ], | |
| 985 | + 'render_type' => 'template', | |
| 986 | + 'condition' => [ | |
| 987 | + 'lightbox_border_type!' => 'none', | |
| 988 | + ], | |
| 989 | + ] | |
| 990 | + ); | |
| 991 | + | |
| 992 | + $this->add_control( | |
| 993 | + 'lightbox_text_spacing', | |
| 994 | + [ | |
| 995 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 996 | + 'type' => Controls_Manager::SLIDER, | |
| 997 | + 'size_units' => ['px'], | |
| 998 | + 'range' => [ | |
| 999 | + 'px' => [ | |
| 1000 | + 'min' => 0, | |
| 1001 | + 'max' => 25, | |
| 1002 | + ], | |
| 1003 | + ], | |
| 1004 | + 'default' => [ | |
| 1005 | + 'unit' => 'px', | |
| 1006 | + 'size' => 5, | |
| 1007 | + ], | |
| 1008 | + 'selectors' => [ | |
| 1009 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 1010 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 1011 | + ], | |
| 1012 | + 'separator' => 'before' | |
| 1013 | + ] | |
| 1014 | + ); | |
| 1015 | + | |
| 1016 | + $this->add_responsive_control( | |
| 1017 | + 'lightbox_padding', | |
| 1018 | + [ | |
| 1019 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 1020 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1021 | + 'size_units' => ['px', '%'], | |
| 1022 | + 'default' => [ | |
| 1023 | + 'top' => 0, | |
| 1024 | + 'right' => 0, | |
| 1025 | + 'bottom' => 0, | |
| 1026 | + 'left' => 0, | |
| 1027 | + ], | |
| 1028 | + 'selectors' => [ | |
| 1029 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1030 | + ], | |
| 1031 | + 'render_type' => 'template', | |
| 1032 | + 'separator' => 'before', | |
| 1033 | + ] | |
| 1034 | + ); | |
| 1035 | + | |
| 1036 | + $this->add_responsive_control( | |
| 1037 | + 'lightbox_margin', | |
| 1038 | + [ | |
| 1039 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 1040 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1041 | + 'size_units' => ['px', '%'], | |
| 1042 | + 'default' => [ | |
| 1043 | + 'top' => 0, | |
| 1044 | + 'right' => 0, | |
| 1045 | + 'bottom' => 0, | |
| 1046 | + 'left' => 0, | |
| 1047 | + ], | |
| 1048 | + 'render_type' => 'template', | |
| 1049 | + 'selectors' => [ | |
| 1050 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1051 | + ], | |
| 1052 | + ] | |
| 1053 | + ); | |
| 1054 | + | |
| 1055 | + $this->add_control( | |
| 1056 | + 'lightbox_radius', | |
| 1057 | + [ | |
| 1058 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 1059 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1060 | + 'size_units' => ['px', '%'], | |
| 1061 | + 'default' => [ | |
| 1062 | + 'top' => 2, | |
| 1063 | + 'right' => 2, | |
| 1064 | + 'bottom' => 2, | |
| 1065 | + 'left' => 2, | |
| 1066 | + ], | |
| 1067 | + 'selectors' => [ | |
| 1068 | + '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1069 | + ], | |
| 1070 | + 'separator' => 'before', | |
| 1071 | + ] | |
| 1072 | + ); | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | +$this->end_controls_section(); | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + } | |
| 1081 | + | |
| 1082 | + public function add_control_lightbox_popup_thumbnails() | |
| 1083 | + { | |
| 1084 | + $this->add_control( | |
| 1085 | + 'lightbox_popup_thumbnails', | |
| 1086 | + [ | |
| 1087 | + 'label' => sprintf(__('Show Thumbnails %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 1088 | + 'type' => Controls_Manager::SWITCHER, | |
| 1089 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 1090 | + ] | |
| 1091 | + ); | |
| 1092 | + } | |
| 1093 | + | |
| 1094 | + public function add_control_lightbox_popup_thumbnails_default() | |
| 1095 | + { | |
| 1096 | + $this->add_control( | |
| 1097 | + 'popup_thumbnails_default', | |
| 1098 | + [ | |
| 1099 | + 'label' => sprintf(__('Show Thumbs by Default %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 1100 | + 'type' => Controls_Manager::SWITCHER, | |
| 1101 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 1102 | + ] | |
| 1103 | + ); | |
| 1104 | + } | |
| 1105 | + | |
| 1106 | + public function add_control_lightbox_popup_sharing() | |
| 1107 | + { | |
| 1108 | + $this->add_control( | |
| 1109 | + 'lightbox_popup_sharing', | |
| 1110 | + [ | |
| 1111 | + 'label' => sprintf(__('Show Sharing Button %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 1112 | + 'type' => Controls_Manager::SWITCHER, | |
| 1113 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 1114 | + ] | |
| 1115 | + ); | |
| 1116 | + } | |
| 1117 | + | |
| 1118 | + public function add_control_filters_deeplinking() | |
| 1119 | + { | |
| 1120 | + $this->add_control( | |
| 1121 | + 'filters_deeplinking', | |
| 1122 | + [ | |
| 1123 | + 'label' => sprintf(__('Enable Deep Linking %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 1124 | + 'type' => Controls_Manager::SWITCHER, | |
| 1125 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 1126 | + ] | |
| 1127 | + ); | |
| 1128 | + } | |
| 1129 | + | |
| 1130 | + public function add_control_filters_animation() | |
| 1131 | + { | |
| 1132 | + $this->add_control( | |
| 1133 | + 'filters_animation', | |
| 1134 | + [ | |
| 1135 | + 'label' => esc_html__('Select Animation', 'king-addons'), | |
| 1136 | + 'type' => Controls_Manager::SELECT, | |
| 1137 | + 'default' => 'default', | |
| 1138 | + 'options' => [ | |
| 1139 | + 'default' => esc_html__('Default', 'king-addons'), | |
| 1140 | + 'zoom' => esc_html__('Zoom', 'king-addons'), | |
| 1141 | + 'pro-fd' => esc_html__('Fade (Pro)', 'king-addons'), | |
| 1142 | + 'pro-fs' => esc_html__('Fade + SlideUp (Pro)', 'king-addons'), | |
| 1143 | + ], | |
| 1144 | + 'separator' => 'before', | |
| 1145 | + ] | |
| 1146 | + ); | |
| 1147 | + } | |
| 1148 | + | |
| 1149 | + public function add_control_filters_icon() | |
| 1150 | + { | |
| 1151 | + } | |
| 1152 | + | |
| 1153 | + public function add_control_filters_icon_align() | |
| 1154 | + { | |
| 1155 | + } | |
| 1156 | + | |
| 1157 | + public function add_control_filters_count() | |
| 1158 | + { | |
| 1159 | + $this->add_control( | |
| 1160 | + 'filters_count', | |
| 1161 | + [ | |
| 1162 | + 'label' => sprintf(__('Show Count %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'), | |
| 1163 | + 'type' => Controls_Manager::SWITCHER, | |
| 1164 | + 'classes' => 'king-addons-pro-control no-distance' | |
| 1165 | + ] | |
| 1166 | + ); | |
| 1167 | + } | |
| 1168 | + | |
| 1169 | + public function add_control_filters_count_superscript() | |
| 1170 | + { | |
| 1171 | + } | |
| 1172 | + | |
| 1173 | + public function add_control_filters_count_brackets() | |
| 1174 | + { | |
| 1175 | + } | |
| 1176 | + | |
| 1177 | + public function add_control_filters_default_filter() | |
| 1178 | + { | |
| 1179 | + } | |
| 1180 | + | |
| 1181 | + public function add_control_pagination_type() | |
| 1182 | + { | |
| 1183 | + $options = [ | |
| 1184 | + 'default' => esc_html__('Default', 'king-addons'), | |
| 1185 | + 'numbered' => esc_html__('Numbered', 'king-addons'), | |
| 1186 | + 'load-more' => esc_html__('Load More Button', 'king-addons'), | |
| 1187 | + 'pro-is' => esc_html__('Infinite Scrolling (Pro)', 'king-addons'), | |
| 1188 | + ]; | |
| 1189 | + | |
| 1190 | + if (king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 1191 | + $options = [ | |
| 1192 | + 'default' => esc_html__('Default', 'king-addons'), | |
| 1193 | + 'load-more' => esc_html__('Load More Button', 'king-addons'), | |
| 1194 | + 'pro-nb' => esc_html__('Numbered (Pro)', 'king-addons'), | |
| 1195 | + 'pro-is' => esc_html__('Infinite Scrolling (Pro)', 'king-addons'), | |
| 1196 | + ]; | |
| 1197 | + } | |
| 1198 | + | |
| 1199 | + $this->add_control( | |
| 1200 | + 'pagination_type', | |
| 1201 | + [ | |
| 1202 | + 'label' => esc_html__('Select Type', 'king-addons'), | |
| 1203 | + 'type' => Controls_Manager::SELECT, | |
| 1204 | + 'default' => 'load-more', | |
| 1205 | + 'options' => $options, | |
| 1206 | + 'separator' => 'after' | |
| 1207 | + ] | |
| 1208 | + ); | |
| 1209 | + } | |
| 1210 | + | |
| 1211 | + public function add_section_style_likes() | |
| 1212 | + { | |
| 1213 | + } | |
| 1214 | + | |
| 1215 | + public function add_section_style_sharing() | |
| 1216 | + { | |
| 1217 | + } | |
| 1218 | + | |
| 1219 | + public function add_section_style_custom_field1() | |
| 1220 | + { | |
| 1221 | + } | |
| 1222 | + | |
| 1223 | + public function add_section_style_custom_field2() | |
| 1224 | + { | |
| 1225 | + } | |
| 1226 | + | |
| 1227 | + public function add_section_style_custom_field3() | |
| 1228 | + { | |
| 1229 | + } | |
| 1230 | + | |
| 1231 | + public function add_section_style_custom_field4() | |
| 1232 | + { | |
| 1233 | + } | |
| 1234 | + | |
| 1235 | + public function add_control_grid_item_even_bg_color() | |
| 1236 | + { | |
| 1237 | + } | |
| 1238 | + | |
| 1239 | + public function add_control_grid_item_even_border_color() | |
| 1240 | + { | |
| 1241 | + } | |
| 1242 | + | |
| 1243 | + public function add_control_overlay_color() | |
| 1244 | + { | |
| 1245 | + $this->add_control( | |
| 1246 | + 'overlay_color', | |
| 1247 | + [ | |
| 1248 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 1249 | + 'type' => Controls_Manager::COLOR, | |
| 1250 | + 'default' => 'rgba(0, 0, 0, 0.25)', | |
| 1251 | + 'selectors' => [ | |
| 1252 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'background-color: {{VALUE}}', | |
| 1253 | + ], | |
| 1254 | + ] | |
| 1255 | + ); | |
| 1256 | + } | |
| 1257 | + | |
| 1258 | + public function add_control_overlay_blend_mode() | |
| 1259 | + { | |
| 1260 | + } | |
| 1261 | + | |
| 1262 | + public function add_control_overlay_border_color() | |
| 1263 | + { | |
| 1264 | + } | |
| 1265 | + | |
| 1266 | + public function add_control_overlay_border_type() | |
| 1267 | + { | |
| 1268 | + } | |
| 1269 | + | |
| 1270 | + public function add_control_overlay_border_width() | |
| 1271 | + { | |
| 1272 | + } | |
| 1273 | + | |
| 1274 | + public function add_control_title_pointer_color_hr() | |
| 1275 | + { | |
| 1276 | + } | |
| 1277 | + | |
| 1278 | + public function add_control_title_pointer() | |
| 1279 | + { | |
| 1280 | + } | |
| 1281 | + | |
| 1282 | + public function add_control_title_pointer_height() | |
| 1283 | + { | |
| 1284 | + } | |
| 1285 | + | |
| 1286 | + public function add_control_title_pointer_animation() | |
| 1287 | + { | |
| 1288 | + } | |
| 1289 | + | |
| 1290 | + public function add_control_tax1_custom_colors($meta) | |
| 1291 | + { | |
| 1292 | + } | |
| 1293 | + | |
| 1294 | + public function add_control_tax1_pointer_color_hr() | |
| 1295 | + { | |
| 1296 | + } | |
| 1297 | + | |
| 1298 | + public function add_control_tax1_pointer() | |
| 1299 | + { | |
| 1300 | + } | |
| 1301 | + | |
| 1302 | + public function add_control_tax1_pointer_height() | |
| 1303 | + { | |
| 1304 | + } | |
| 1305 | + | |
| 1306 | + public function add_control_tax1_pointer_animation() | |
| 1307 | + { | |
| 1308 | + } | |
| 1309 | + | |
| 1310 | + public function add_control_tax2_pointer_color_hr() | |
| 1311 | + { | |
| 1312 | + } | |
| 1313 | + | |
| 1314 | + public function add_control_tax2_pointer() | |
| 1315 | + { | |
| 1316 | + } | |
| 1317 | + | |
| 1318 | + public function add_control_tax2_pointer_height() | |
| 1319 | + { | |
| 1320 | + } | |
| 1321 | + | |
| 1322 | + public function add_control_tax2_pointer_animation() | |
| 1323 | + { | |
| 1324 | + } | |
| 1325 | + | |
| 1326 | + public function add_control_read_more_animation() | |
| 1327 | + { | |
| 1328 | + } | |
| 1329 | + | |
| 1330 | + public function add_control_read_more_animation_height() | |
| 1331 | + { | |
| 1332 | + } | |
| 1333 | + | |
| 1334 | + public function add_control_filters_pointer_color_hr() | |
| 1335 | + { | |
| 1336 | + } | |
| 1337 | + | |
| 1338 | + public function add_control_filters_pointer() | |
| 1339 | + { | |
| 1340 | + } | |
| 1341 | + | |
| 1342 | + public function add_control_filters_pointer_height() | |
| 1343 | + { | |
| 1344 | + } | |
| 1345 | + | |
| 1346 | + public function add_control_filters_pointer_animation() | |
| 1347 | + { | |
| 1348 | + } | |
| 1349 | + | |
| 1350 | + public function add_control_stack_grid_slider_nav_position() | |
| 1351 | + { | |
| 1352 | + } | |
| 1353 | + | |
| 1354 | + public function add_control_grid_slider_dots_hr() | |
| 1355 | + { | |
| 1356 | + } | |
| 1357 | + | |
| 1358 | + protected function register_controls() | |
| 1359 | + { | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + $this->start_controls_section( | |
| 1363 | + 'section_grid_query', | |
| 1364 | + [ | |
| 1365 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Query', 'king-addons'), | |
| 1366 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 1367 | + ] | |
| 1368 | + ); | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + $post_types = $this->add_option_query_source(); | |
| 1372 | + | |
| 1373 | + $post_taxonomies = $this->get_available_taxonomies(); | |
| 1374 | + | |
| 1375 | + $tax_meta_keys = Core::getCustomMetaKeysTaxonomies(); | |
| 1376 | + | |
| 1377 | + $this->add_control( | |
| 1378 | + 'query_source', | |
| 1379 | + [ | |
| 1380 | + 'label' => esc_html__('Source', 'king-addons'), | |
| 1381 | + 'type' => Controls_Manager::SELECT, | |
| 1382 | + 'default' => 'post', | |
| 1383 | + 'options' => $post_types, | |
| 1384 | + ] | |
| 1385 | + ); | |
| 1386 | + | |
| 1387 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'query_source', ['pro-rl']); | |
| 1388 | + | |
| 1389 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 1390 | + $this->add_control( | |
| 1391 | + 'query_source_cpt_pro_notice', | |
| 1392 | + [ | |
| 1393 | + '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>', | |
| 1394 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1395 | + 'content_classes' => 'king-addons-pro-notice', | |
| 1396 | + 'condition' => [ | |
| 1397 | + 'query_source!' => ['post', 'page', 'related', 'current', 'pro-rl'], | |
| 1398 | + ] | |
| 1399 | + ] | |
| 1400 | + ); | |
| 1401 | + } | |
| 1402 | + | |
| 1403 | + $this->add_control( | |
| 1404 | + 'query_selection', | |
| 1405 | + [ | |
| 1406 | + 'label' => esc_html__('Selection', 'king-addons'), | |
| 1407 | + 'type' => Controls_Manager::SELECT, | |
| 1408 | + 'default' => 'dynamic', | |
| 1409 | + 'options' => [ | |
| 1410 | + 'dynamic' => esc_html__('Dynamic', 'king-addons'), | |
| 1411 | + 'manual' => esc_html__('Manual', 'king-addons'), | |
| 1412 | + ], | |
| 1413 | + 'condition' => [ | |
| 1414 | + 'query_source!' => ['current', 'related'], | |
| 1415 | + ], | |
| 1416 | + ] | |
| 1417 | + ); | |
| 1418 | + | |
| 1419 | + $this->add_control_order_posts(); | |
| 1420 | + | |
| 1421 | + $this->add_control_order_posts_by_acf([]); | |
| 1422 | + | |
| 1423 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'order_posts', ['pro-tl', 'pro-mf', 'pro-d', 'pro-ar', 'pro-cc']); | |
| 1424 | + | |
| 1425 | + $this->add_control( | |
| 1426 | + 'order_direction', | |
| 1427 | + [ | |
| 1428 | + 'label' => esc_html__('Order', 'king-addons'), | |
| 1429 | + 'type' => Controls_Manager::SELECT, | |
| 1430 | + 'default' => 'DESC', | |
| 1431 | + 'label_block' => false, | |
| 1432 | + 'options' => [ | |
| 1433 | + 'ASC' => esc_html__('Ascending', 'king-addons'), | |
| 1434 | + 'DESC' => esc_html__('Descending', 'king-addons'), | |
| 1435 | + ], | |
| 1436 | + 'condition' => [ | |
| 1437 | + 'query_randomize!' => 'rand', | |
| 1438 | + ] | |
| 1439 | + ] | |
| 1440 | + ); | |
| 1441 | + | |
| 1442 | + $this->add_control( | |
| 1443 | + 'query_tax_selection', | |
| 1444 | + [ | |
| 1445 | + 'label' => esc_html__('Select Taxonomy', 'king-addons'), | |
| 1446 | + 'type' => Controls_Manager::SELECT, | |
| 1447 | + 'default' => 'category', | |
| 1448 | + 'options' => $post_taxonomies, | |
| 1449 | + 'condition' => [ | |
| 1450 | + 'query_source' => 'related', | |
| 1451 | + ], | |
| 1452 | + ] | |
| 1453 | + ); | |
| 1454 | + | |
| 1455 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 1456 | + $this->add_control( | |
| 1457 | + 'query_tax_selection_pro_notice', | |
| 1458 | + [ | |
| 1459 | + '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>', | |
| 1460 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1461 | + 'content_classes' => 'king-addons-pro-notice', | |
| 1462 | + 'condition' => [ | |
| 1463 | + 'query_tax_selection!' => ['category', 'post_tag'], | |
| 1464 | + ] | |
| 1465 | + ] | |
| 1466 | + ); | |
| 1467 | + } | |
| 1468 | + | |
| 1469 | + $this->add_control( | |
| 1470 | + 'query_author', | |
| 1471 | + [ | |
| 1472 | + 'label' => esc_html__('Authors', 'king-addons'), | |
| 1473 | + 'type' => 'king-addons-ajax-select2', | |
| 1474 | + 'options' => 'ajaxselect2/getUsers', | |
| 1475 | + 'multiple' => true, | |
| 1476 | + 'label_block' => true, | |
| 1477 | + 'separator' => 'before', | |
| 1478 | + 'condition' => [ | |
| 1479 | + 'query_source!' => ['current', 'related'], | |
| 1480 | + 'query_selection' => 'dynamic', | |
| 1481 | + ], | |
| 1482 | + ] | |
| 1483 | + ); | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + foreach ($post_taxonomies as $slug => $title) { | |
| 1487 | + global $wp_taxonomies; | |
| 1488 | + $post_type = ''; | |
| 1489 | + | |
| 1490 | + if (isset($wp_taxonomies[$slug]->object_type[0])) { | |
| 1491 | + $post_type = $wp_taxonomies[$slug]->object_type[0]; | |
| 1492 | + } | |
| 1493 | + | |
| 1494 | + $this->add_control( | |
| 1495 | + 'query_taxonomy_' . $slug, | |
| 1496 | + [ | |
| 1497 | + 'label' => $title, | |
| 1498 | + 'type' => 'king-addons-ajax-select2', | |
| 1499 | + 'options' => 'ajaxselect2/getTaxonomies', | |
| 1500 | + 'query_slug' => $slug, | |
| 1501 | + 'multiple' => true, | |
| 1502 | + 'label_block' => true, | |
| 1503 | + 'condition' => [ | |
| 1504 | + 'query_source' => $post_type, | |
| 1505 | + 'query_selection' => 'dynamic', | |
| 1506 | + ], | |
| 1507 | + ] | |
| 1508 | + ); | |
| 1509 | + } | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + foreach ($post_types as $slug => $title) { | |
| 1513 | + $this->add_control( | |
| 1514 | + 'query_exclude_' . $slug, | |
| 1515 | + [ | |
| 1516 | + 'label' => esc_html__('Exclude ', 'king-addons') . $title, | |
| 1517 | + 'type' => 'king-addons-ajax-select2', | |
| 1518 | + 'options' => 'ajaxselect2/getPostsByPostType', | |
| 1519 | + 'query_slug' => $slug, | |
| 1520 | + 'multiple' => true, | |
| 1521 | + 'label_block' => true, | |
| 1522 | + 'condition' => [ | |
| 1523 | + 'query_source' => $slug, | |
| 1524 | + 'query_source!' => ['current', 'related'], | |
| 1525 | + 'query_selection' => 'dynamic', | |
| 1526 | + ], | |
| 1527 | + ] | |
| 1528 | + ); | |
| 1529 | + } | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + foreach ($post_types as $slug => $title) { | |
| 1533 | + $this->add_control( | |
| 1534 | + 'query_manual_' . $slug, | |
| 1535 | + [ | |
| 1536 | + 'label' => esc_html__('Select ', 'king-addons') . $title, | |
| 1537 | + 'type' => 'king-addons-ajax-select2', | |
| 1538 | + 'options' => 'ajaxselect2/getPostsByPostType', | |
| 1539 | + 'query_slug' => $slug, | |
| 1540 | + 'multiple' => true, | |
| 1541 | + 'label_block' => true, | |
| 1542 | + 'condition' => [ | |
| 1543 | + 'query_source' => $slug, | |
| 1544 | + 'query_selection' => 'manual', | |
| 1545 | + ], | |
| 1546 | + 'separator' => 'before', | |
| 1547 | + ] | |
| 1548 | + ); | |
| 1549 | + } | |
| 1550 | + | |
| 1551 | + $this->add_control( | |
| 1552 | + 'query_posts_per_page', | |
| 1553 | + [ | |
| 1554 | + 'label' => esc_html__('Items Per Page', 'king-addons'), | |
| 1555 | + 'type' => Controls_Manager::NUMBER, | |
| 1556 | + 'default' => 9, | |
| 1557 | + 'min' => 0, | |
| 1558 | + 'condition' => (king_addons_freemius()->can_use_premium_code__premium_only() ? ['query_source!' => 'current', 'layout_select!' => 'slider',] : ['query_source!' => 'current']), | |
| 1559 | + ] | |
| 1560 | + ); | |
| 1561 | + | |
| 1562 | + if (king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 1563 | + $this->add_control_query_slides_to_show(); | |
| 1564 | + } else { | |
| 1565 | + $this->add_control( | |
| 1566 | + 'limit_slides_to_show_pro_notice', | |
| 1567 | + [ | |
| 1568 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1569 | + 'raw' => 'More than <strong>4 Slides</strong> are available<br>in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>', | |
| 1570 | + | |
| 1571 | + 'content_classes' => 'king-addons-pro-notice', | |
| 1572 | + 'condition' => [ | |
| 1573 | + 'layout_select' => 'slider', | |
| 1574 | + ] | |
| 1575 | + ] | |
| 1576 | + ); | |
| 1577 | + } | |
| 1578 | + | |
| 1579 | + $this->add_control( | |
| 1580 | + 'query_offset', | |
| 1581 | + [ | |
| 1582 | + 'label' => esc_html__('Offset', 'king-addons'), | |
| 1583 | + 'type' => Controls_Manager::NUMBER, | |
| 1584 | + 'default' => 0, | |
| 1585 | + 'min' => 0, | |
| 1586 | + 'condition' => [ | |
| 1587 | + 'query_selection' => 'dynamic', | |
| 1588 | + ] | |
| 1589 | + ] | |
| 1590 | + ); | |
| 1591 | + | |
| 1592 | + $this->add_control( | |
| 1593 | + 'query_not_found_text', | |
| 1594 | + [ | |
| 1595 | + 'label' => esc_html__('Not Found Text', 'king-addons'), | |
| 1596 | + 'type' => Controls_Manager::TEXT, | |
| 1597 | + 'dynamic' => [ | |
| 1598 | + 'active' => true, | |
| 1599 | + ], | |
| 1600 | + 'default' => 'No Posts Found!', | |
| 1601 | + 'condition' => [ | |
| 1602 | + 'query_selection' => 'dynamic', | |
| 1603 | + 'query_source!' => 'related', | |
| 1604 | + ] | |
| 1605 | + ] | |
| 1606 | + ); | |
| 1607 | + | |
| 1608 | + $this->add_control_display_scheduled_posts(); | |
| 1609 | + | |
| 1610 | + // TODO: Under development feature. | |
| 1611 | +// $this->add_control_query_randomize(); | |
| 1612 | + | |
| 1613 | + $this->add_control( | |
| 1614 | + 'query_exclude_no_images', | |
| 1615 | + [ | |
| 1616 | + 'label' => esc_html__('Exclude Items without Thumbnail', 'king-addons'), | |
| 1617 | + 'type' => Controls_Manager::SWITCHER, | |
| 1618 | + 'return_value' => 'yes', | |
| 1619 | + 'label_block' => false | |
| 1620 | + ] | |
| 1621 | + ); | |
| 1622 | + | |
| 1623 | + /** @noinspection HtmlUnknownTarget */ | |
| 1624 | + $this->add_control( | |
| 1625 | + 'current_query_notice', | |
| 1626 | + [ | |
| 1627 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1628 | + 'raw' => sprintf(__('To set Posts per Page for all Blog <strong>Archive Pages</strong>, navigate to <strong><a href="%s" target="_blank">Settings > Reading</a></strong>.', 'king-addons'), admin_url('options-reading.php')), | |
| 1629 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', | |
| 1630 | + 'condition' => [ | |
| 1631 | + 'query_source' => 'current', | |
| 1632 | + ], | |
| 1633 | + ] | |
| 1634 | + ); | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + $this->add_control( | |
| 1638 | + 'element_select_filter', | |
| 1639 | + [ | |
| 1640 | + 'type' => Controls_Manager::HIDDEN, | |
| 1641 | + 'default' => $this->get_related_taxonomies(), | |
| 1642 | + ] | |
| 1643 | + ); | |
| 1644 | + | |
| 1645 | + $this->end_controls_section(); | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + $this->start_controls_section( | |
| 1649 | + 'section_grid_layout', | |
| 1650 | + [ | |
| 1651 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Layout', 'king-addons'), | |
| 1652 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 1653 | + ] | |
| 1654 | + ); | |
| 1655 | + | |
| 1656 | + $this->add_control_layout_select(); | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'layout_select', ['pro-ms']); | |
| 1660 | + | |
| 1661 | + $this->add_control( | |
| 1662 | + 'stick_last_element_to_bottom', | |
| 1663 | + [ | |
| 1664 | + 'label' => esc_html__('Last Element to Bottom', 'king-addons'), | |
| 1665 | + 'type' => Controls_Manager::SWITCHER, | |
| 1666 | + 'default' => '', | |
| 1667 | + 'render_type' => 'template', | |
| 1668 | + | |
| 1669 | + 'condition' => [ | |
| 1670 | + 'layout_select' => 'fitRows', | |
| 1671 | + ] | |
| 1672 | + ] | |
| 1673 | + ); | |
| 1674 | + | |
| 1675 | + $this->add_control( | |
| 1676 | + 'last_element_position', | |
| 1677 | + [ | |
| 1678 | + 'label' => esc_html__('Last Element Position', 'king-addons'), | |
| 1679 | + 'type' => Controls_Manager::CHOOSE, | |
| 1680 | + 'label_block' => false, | |
| 1681 | + 'default' => 'left', | |
| 1682 | + 'options' => [ | |
| 1683 | + 'left' => [ | |
| 1684 | + 'title' => esc_html__('Left', 'king-addons'), | |
| 1685 | + 'icon' => 'eicon-h-align-left', | |
| 1686 | + ], | |
| 1687 | + 'center' => [ | |
| 1688 | + 'title' => esc_html__('Center', 'king-addons'), | |
| 1689 | + 'icon' => 'eicon-h-align-center', | |
| 1690 | + ], | |
| 1691 | + 'right' => [ | |
| 1692 | + 'title' => esc_html__('Right', 'king-addons'), | |
| 1693 | + 'icon' => 'eicon-h-align-right', | |
| 1694 | + ] | |
| 1695 | + ], | |
| 1696 | + 'selectors_dictionary' => [ | |
| 1697 | + 'left' => 'left: 0; right: auto;', | |
| 1698 | + 'center' => 'left: 50%; transform: translateX(-50%);', | |
| 1699 | + 'right' => 'left: auto; right: 0;' | |
| 1700 | + ], | |
| 1701 | + 'selectors' => [ | |
| 1702 | + '{{WRAPPER}}.king-addons-grid-last-element-yes .king-addons-grid-item-below-content>div:last-child' => '{{VALUE}}', | |
| 1703 | + ], | |
| 1704 | + 'render_type' => 'template', | |
| 1705 | + 'separator' => 'after' | |
| 1706 | + ] | |
| 1707 | + ); | |
| 1708 | + | |
| 1709 | + $this->add_group_control( | |
| 1710 | + Group_Control_Image_Size::get_type(), | |
| 1711 | + [ | |
| 1712 | + 'name' => 'layout_image_crop', | |
| 1713 | + 'default' => 'full', | |
| 1714 | + ] | |
| 1715 | + ); | |
| 1716 | + | |
| 1717 | + $this->add_control_layout_columns(); | |
| 1718 | + | |
| 1719 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 1720 | + $this->add_control( | |
| 1721 | + 'grid_columns_pro_notice', | |
| 1722 | + [ | |
| 1723 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1724 | + 'raw' => 'Grid Columns option is fully supported<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>', | |
| 1725 | + | |
| 1726 | + 'content_classes' => 'king-addons-pro-notice', | |
| 1727 | + ] | |
| 1728 | + ); | |
| 1729 | + } | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + $this->add_control( | |
| 1733 | + 'layout_list_media_section', | |
| 1734 | + [ | |
| 1735 | + 'label' => esc_html__('Media', 'king-addons'), | |
| 1736 | + 'type' => Controls_Manager::HEADING, | |
| 1737 | + 'separator' => 'before', | |
| 1738 | + 'condition' => [ | |
| 1739 | + 'layout_select' => 'list', | |
| 1740 | + ], | |
| 1741 | + ] | |
| 1742 | + ); | |
| 1743 | + | |
| 1744 | + /** | |
| 1745 | + * Add a switcher control to allow users to hide the post thumbnail in the grid. | |
| 1746 | + * | |
| 1747 | + * @since 1.0.0 | |
| 1748 | + */ | |
| 1749 | + $this->add_control( | |
| 1750 | + 'hide_post_thumbnail', | |
| 1751 | + [ | |
| 1752 | + 'label' => esc_html__('Hide Post Thumbnail', 'king-addons'), | |
| 1753 | + 'type' => Controls_Manager::SWITCHER, | |
| 1754 | + 'default' => '', | |
| 1755 | + 'return_value' => 'yes', | |
| 1756 | + 'separator' => 'before', | |
| 1757 | + 'description' => esc_html__('Completely hide the post featured image/thumbnail in the grid.', 'king-addons'), | |
| 1758 | + ] | |
| 1759 | + ); | |
| 1760 | + | |
| 1761 | + $this->add_control( | |
| 1762 | + 'layout_list_align', | |
| 1763 | + [ | |
| 1764 | + 'label' => esc_html__('Alignment', 'king-addons'), | |
| 1765 | + 'type' => Controls_Manager::SELECT, | |
| 1766 | + 'default' => 'left', | |
| 1767 | + 'options' => [ | |
| 1768 | + 'left' => esc_html__('Left', 'king-addons'), | |
| 1769 | + 'right' => esc_html__('Right', 'king-addons'), | |
| 1770 | + 'zigzag' => esc_html__('ZigZag', 'king-addons'), | |
| 1771 | + ], | |
| 1772 | + 'condition' => [ | |
| 1773 | + 'layout_select' => 'list', | |
| 1774 | + ], | |
| 1775 | + ] | |
| 1776 | + ); | |
| 1777 | + | |
| 1778 | + $this->add_control( | |
| 1779 | + 'layout_list_media_width', | |
| 1780 | + [ | |
| 1781 | + 'label' => esc_html__('Width', 'king-addons'), | |
| 1782 | + 'type' => Controls_Manager::SLIDER, | |
| 1783 | + 'default' => [ | |
| 1784 | + 'size' => 30, | |
| 1785 | + ], | |
| 1786 | + 'range' => [ | |
| 1787 | + '%' => [ | |
| 1788 | + 'min' => 0, | |
| 1789 | + 'max' => 100, | |
| 1790 | + ], | |
| 1791 | + ], | |
| 1792 | + 'condition' => [ | |
| 1793 | + 'layout_select' => 'list', | |
| 1794 | + ] | |
| 1795 | + ] | |
| 1796 | + ); | |
| 1797 | + | |
| 1798 | + $this->add_control( | |
| 1799 | + 'layout_list_media_distance', | |
| 1800 | + [ | |
| 1801 | + 'label' => esc_html__('Distance', 'king-addons'), | |
| 1802 | + 'type' => Controls_Manager::SLIDER, | |
| 1803 | + 'default' => [ | |
| 1804 | + 'size' => 20, | |
| 1805 | + ], | |
| 1806 | + 'range' => [ | |
| 1807 | + 'px' => [ | |
| 1808 | + 'min' => 0, | |
| 1809 | + 'max' => 100, | |
| 1810 | + ], | |
| 1811 | + ], | |
| 1812 | + 'condition' => [ | |
| 1813 | + 'layout_select' => 'list', | |
| 1814 | + ] | |
| 1815 | + ] | |
| 1816 | + ); | |
| 1817 | + | |
| 1818 | + $this->add_responsive_control( | |
| 1819 | + 'layout_gutter_hr', | |
| 1820 | + [ | |
| 1821 | + 'label' => esc_html__('Horizontal Gutter', 'king-addons'), | |
| 1822 | + 'type' => Controls_Manager::SLIDER, | |
| 1823 | + 'range' => [ | |
| 1824 | + 'px' => [ | |
| 1825 | + 'min' => 0, | |
| 1826 | + 'max' => 150, | |
| 1827 | + ], | |
| 1828 | + ], | |
| 1829 | + 'default' => [ | |
| 1830 | + 'size' => 15, | |
| 1831 | + ], | |
| 1832 | + 'widescreen_default' => [ | |
| 1833 | + 'size' => 15, | |
| 1834 | + ], | |
| 1835 | + 'laptop_default' => [ | |
| 1836 | + 'size' => 15, | |
| 1837 | + ], | |
| 1838 | + 'tablet_extra_default' => [ | |
| 1839 | + 'size' => 15, | |
| 1840 | + ], | |
| 1841 | + 'tablet_default' => [ | |
| 1842 | + 'size' => 15, | |
| 1843 | + ], | |
| 1844 | + 'mobile_extra_default' => [ | |
| 1845 | + 'size' => 15, | |
| 1846 | + ], | |
| 1847 | + 'mobile_default' => [ | |
| 1848 | + 'size' => 15, | |
| 1849 | + ], | |
| 1850 | + 'condition' => [ | |
| 1851 | + 'layout_select' => ['fitRows', 'masonry', 'list'], | |
| 1852 | + ], | |
| 1853 | + 'separator' => 'before' | |
| 1854 | + ] | |
| 1855 | + ); | |
| 1856 | + | |
| 1857 | + $this->add_responsive_control( | |
| 1858 | + 'layout_gutter_vr', | |
| 1859 | + [ | |
| 1860 | + 'label' => esc_html__('Vertical Gutter', 'king-addons'), | |
| 1861 | + 'type' => Controls_Manager::SLIDER, | |
| 1862 | + 'range' => [ | |
| 1863 | + 'px' => [ | |
| 1864 | + 'min' => 0, | |
| 1865 | + 'max' => 150, | |
| 1866 | + ], | |
| 1867 | + ], | |
| 1868 | + 'default' => [ | |
| 1869 | + 'size' => 15, | |
| 1870 | + ], | |
| 1871 | + 'condition' => [ | |
| 1872 | + 'layout_select' => ['fitRows', 'masonry', 'list'], | |
| 1873 | + ] | |
| 1874 | + ] | |
| 1875 | + ); | |
| 1876 | + | |
| 1877 | + $this->add_responsive_control( | |
| 1878 | + 'layout_filters', | |
| 1879 | + [ | |
| 1880 | + 'label' => esc_html__('Show Filters', 'king-addons'), | |
| 1881 | + 'type' => Controls_Manager::SWITCHER, | |
| 1882 | + 'default' => 'yes', | |
| 1883 | + 'selectors_dictionary' => [ | |
| 1884 | + '' => 'none', | |
| 1885 | + 'yes' => 'block' | |
| 1886 | + ], | |
| 1887 | + 'selectors' => [ | |
| 1888 | + '{{WRAPPER}} .king-addons-grid-filters' => 'display:{{VALUE}};', | |
| 1889 | + ], | |
| 1890 | + 'render_type' => 'template', | |
| 1891 | + 'separator' => 'before', | |
| 1892 | + 'condition' => [ | |
| 1893 | + 'layout_select!' => 'slider', | |
| 1894 | + ] | |
| 1895 | + ] | |
| 1896 | + ); | |
| 1897 | + | |
| 1898 | + $this->add_control( | |
| 1899 | + 'layout_pagination', | |
| 1900 | + [ | |
| 1901 | + 'label' => esc_html__('Show Pagination', 'king-addons'), | |
| 1902 | + 'description' => esc_html__('Please note that Pagination doesn\'t work in editor.', 'king-addons'), | |
| 1903 | + 'type' => Controls_Manager::SWITCHER, | |
| 1904 | + 'default' => 'yes', | |
| 1905 | + 'return_value' => 'yes', | |
| 1906 | + 'render_type' => 'template', | |
| 1907 | + 'condition' => [ | |
| 1908 | + 'layout_select!' => 'slider', | |
| 1909 | + ] | |
| 1910 | + ] | |
| 1911 | + ); | |
| 1912 | + | |
| 1913 | + $this->add_control( | |
| 1914 | + 'filters_experiment_hr_before', | |
| 1915 | + [ | |
| 1916 | + 'type' => Controls_Manager::DIVIDER, | |
| 1917 | + ] | |
| 1918 | + ); | |
| 1919 | + | |
| 1920 | + // TODO: Implement the Randomize Query feature. | |
| 1921 | + $this->add_control( | |
| 1922 | + 'filters_experiment', | |
| 1923 | + [ | |
| 1924 | + 'label' => esc_html__('Filters & Load More Dynamic Loading (beta feature)', 'king-addons'), | |
| 1925 | + 'type' => Controls_Manager::SWITCHER, | |
| 1926 | + 'default' => 'no', | |
| 1927 | + 'label_block' => false, | |
| 1928 | + 'return_value' => 'yes', | |
| 1929 | + 'render_type' => 'template', | |
| 1930 | + 'separator' => 'after', | |
| 1931 | +// TODO: Later | |
| 1932 | + | |
| 1933 | +// 'conditions' => [ | |
| 1934 | +// 'relation' => 'and', | |
| 1935 | +// 'terms' => [ | |
| 1936 | +// [ | |
| 1937 | +// 'name' => 'layout_filters', | |
| 1938 | +// 'operator' => '!=', | |
| 1939 | +// 'value' => '', | |
| 1940 | +// ], | |
| 1941 | +// [ | |
| 1942 | +// 'relation' => 'or', | |
| 1943 | +// 'terms' => [ | |
| 1944 | +// [ | |
| 1945 | +// 'relation' => 'and', | |
| 1946 | +// 'terms' => [ | |
| 1947 | +// [ | |
| 1948 | +// 'name' => 'layout_pagination', | |
| 1949 | +// 'operator' => '!=', | |
| 1950 | +// 'value' => '', | |
| 1951 | +// ], | |
| 1952 | +// [ | |
| 1953 | +// 'name' => 'pagination_type', | |
| 1954 | +// 'operator' => 'in', | |
| 1955 | +// 'value' => ['load-more', 'infinite'], | |
| 1956 | +// ], | |
| 1957 | +// ] | |
| 1958 | +// ], | |
| 1959 | +// [ | |
| 1960 | +// 'name' => 'layout_pagination', | |
| 1961 | +// 'operator' => '==', | |
| 1962 | +// 'value' => '', | |
| 1963 | +// ] | |
| 1964 | +// ], | |
| 1965 | +// ], | |
| 1966 | +// ] | |
| 1967 | +// ] | |
| 1968 | + ] | |
| 1969 | + ); | |
| 1970 | + | |
| 1971 | + $this->add_control_open_links_in_new_tab(); | |
| 1972 | + | |
| 1973 | + $this->add_control_grid_lazy_loading(); | |
| 1974 | + | |
| 1975 | + $this->add_control_layout_animation(); | |
| 1976 | + | |
| 1977 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'layout_animation', ['pro-fd', 'pro-fs']); | |
| 1978 | + | |
| 1979 | + $this->add_control( | |
| 1980 | + 'layout_animation_duration', | |
| 1981 | + [ | |
| 1982 | + 'label' => esc_html__('Animation Duration', 'king-addons'), | |
| 1983 | + 'type' => Controls_Manager::NUMBER, | |
| 1984 | + 'default' => 0.3, | |
| 1985 | + 'min' => 0, | |
| 1986 | + 'max' => 5, | |
| 1987 | + 'step' => 0.1, | |
| 1988 | + 'condition' => [ | |
| 1989 | + 'layout_animation!' => 'default', | |
| 1990 | + 'layout_select!' => 'slider', | |
| 1991 | + ], | |
| 1992 | + ] | |
| 1993 | + ); | |
| 1994 | + | |
| 1995 | + $this->add_control( | |
| 1996 | + 'layout_animation_delay', | |
| 1997 | + [ | |
| 1998 | + 'label' => esc_html__('Animation Delay', 'king-addons'), | |
| 1999 | + 'type' => Controls_Manager::NUMBER, | |
| 2000 | + 'default' => 0.1, | |
| 2001 | + 'min' => 0, | |
| 2002 | + 'max' => 5, | |
| 2003 | + 'step' => 0.05, | |
| 2004 | + 'condition' => [ | |
| 2005 | + 'layout_animation!' => 'default', | |
| 2006 | + 'layout_select!' => 'slider', | |
| 2007 | + ], | |
| 2008 | + ] | |
| 2009 | + ); | |
| 2010 | + | |
| 2011 | + $this->add_control_layout_slider_amount(); | |
| 2012 | + | |
| 2013 | + $this->add_control( | |
| 2014 | + 'layout_slides_to_scroll', | |
| 2015 | + [ | |
| 2016 | + 'label' => esc_html__('Slides to Scroll', 'king-addons'), | |
| 2017 | + 'type' => Controls_Manager::NUMBER, | |
| 2018 | + 'min' => 1, | |
| 2019 | + 'max' => 10, | |
| 2020 | + 'default' => 1, | |
| 2021 | + 'render_type' => 'template', | |
| 2022 | + 'frontend_available' => true, | |
| 2023 | + 'separator' => 'before', | |
| 2024 | + 'condition' => [ | |
| 2025 | + 'layout_select' => 'slider', | |
| 2026 | + ], | |
| 2027 | + ] | |
| 2028 | + ); | |
| 2029 | + | |
| 2030 | + $this->add_responsive_control( | |
| 2031 | + 'layout_slider_gutter', | |
| 2032 | + [ | |
| 2033 | + 'type' => Controls_Manager::SLIDER, | |
| 2034 | + 'label' => esc_html__('Gutter', 'king-addons'), | |
| 2035 | + 'size_units' => ['px'], | |
| 2036 | + 'range' => [ | |
| 2037 | + 'px' => [ | |
| 2038 | + 'min' => 0, | |
| 2039 | + 'max' => 50, | |
| 2040 | + ] | |
| 2041 | + ], | |
| 2042 | + 'default' => [ | |
| 2043 | + 'unit' => 'px', | |
| 2044 | + 'size' => 10, | |
| 2045 | + ], | |
| 2046 | + 'selectors' => [ | |
| 2047 | + '{{WRAPPER}} .king-addons-grid .slick-slide' => 'margin-left: {{SIZE}}{{UNIT}};', | |
| 2048 | + '{{WRAPPER}} .king-addons-grid .slick-list' => 'margin-left: -{{SIZE}}{{UNIT}};', | |
| 2049 | + ], | |
| 2050 | + 'render_type' => 'template', | |
| 2051 | + 'condition' => [ | |
| 2052 | + 'layout_slider_amount!' => '1', | |
| 2053 | + 'layout_select' => 'slider', | |
| 2054 | + ], | |
| 2055 | + ] | |
| 2056 | + ); | |
| 2057 | + | |
| 2058 | + $this->add_responsive_control( | |
| 2059 | + 'layout_slider_nav', | |
| 2060 | + [ | |
| 2061 | + 'label' => esc_html__('Navigation', 'king-addons'), | |
| 2062 | + 'type' => Controls_Manager::SWITCHER, | |
| 2063 | + 'default' => 'yes', | |
| 2064 | + 'widescreen_default' => 'yes', | |
| 2065 | + 'laptop_default' => 'yes', | |
| 2066 | + 'tablet_extra_default' => 'yes', | |
| 2067 | + 'tablet_default' => 'yes', | |
| 2068 | + 'mobile_extra_default' => 'yes', | |
| 2069 | + 'mobile_default' => 'yes', | |
| 2070 | + 'selectors_dictionary' => [ | |
| 2071 | + '' => 'none', | |
| 2072 | + 'yes' => 'flex' | |
| 2073 | + ], | |
| 2074 | + 'selectors' => [ | |
| 2075 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'display:{{VALUE}} !important;', | |
| 2076 | + ], | |
| 2077 | + 'separator' => 'before', | |
| 2078 | + 'condition' => [ | |
| 2079 | + 'layout_select' => 'slider', | |
| 2080 | + ] | |
| 2081 | + ] | |
| 2082 | + ); | |
| 2083 | + | |
| 2084 | + $this->add_control_layout_slider_nav_hover(); | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + $this->add_control( | |
| 2088 | + 'layout_slider_nav_icon', | |
| 2089 | + [ | |
| 2090 | + 'label' => esc_html__('Select Icon', 'king-addons'), | |
| 2091 | + 'type' => Controls_Manager::SELECT, | |
| 2092 | + 'default' => 'fas fa-angle-left', | |
| 2093 | + 'options' => [ | |
| 2094 | + 'fas fa-angle-left' => esc_html__('Angle', 'king-addons'), | |
| 2095 | + 'fas fa-angle-double-left' => esc_html__('Angle Double', 'king-addons'), | |
| 2096 | + 'fas fa-arrow-left' => esc_html__('Arrow', 'king-addons'), | |
| 2097 | + 'fas fa-arrow-alt-circle-left' => esc_html__('Arrow Circle', 'king-addons'), | |
| 2098 | + 'far fa-arrow-alt-circle-left' => esc_html__('Arrow Circle Alt', 'king-addons'), | |
| 2099 | + 'fas fa-long-arrow-alt-left' => esc_html__('Long Arrow', 'king-addons'), | |
| 2100 | + 'fas fa-chevron-left' => esc_html__('Chevron', 'king-addons'), | |
| 2101 | + ], | |
| 2102 | + 'separator' => 'after', | |
| 2103 | + 'condition' => [ | |
| 2104 | + 'layout_slider_nav' => 'yes', | |
| 2105 | + 'layout_select' => 'slider', | |
| 2106 | + ], | |
| 2107 | + ] | |
| 2108 | + ); | |
| 2109 | + | |
| 2110 | + $this->add_responsive_control( | |
| 2111 | + 'layout_slider_dots', | |
| 2112 | + [ | |
| 2113 | + 'label' => esc_html__('Pagination', 'king-addons'), | |
| 2114 | + 'type' => Controls_Manager::SWITCHER, | |
| 2115 | + 'default' => 'yes', | |
| 2116 | + 'widescreen_default' => 'yes', | |
| 2117 | + 'laptop_default' => 'yes', | |
| 2118 | + 'tablet_extra_default' => 'yes', | |
| 2119 | + 'tablet_default' => 'yes', | |
| 2120 | + 'mobile_extra_default' => 'yes', | |
| 2121 | + 'mobile_default' => 'yes', | |
| 2122 | + 'selectors_dictionary' => [ | |
| 2123 | + '' => 'none', | |
| 2124 | + 'yes' => 'inline-table' | |
| 2125 | + ], | |
| 2126 | + 'selectors' => [ | |
| 2127 | + '{{WRAPPER}} .king-addons-grid-slider-dots' => 'display:{{VALUE}};', | |
| 2128 | + ], | |
| 2129 | + 'render_type' => 'template', | |
| 2130 | + 'condition' => [ | |
| 2131 | + 'layout_select' => 'slider', | |
| 2132 | + ], | |
| 2133 | + ] | |
| 2134 | + ); | |
| 2135 | + | |
| 2136 | + $this->add_control_layout_slider_dots_position(); | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'layout_slider_dots_position', ['pro-vr']); | |
| 2140 | + | |
| 2141 | + $this->add_control_layout_slider_autoplay(); | |
| 2142 | + | |
| 2143 | + $this->add_controls_group_layout_slider_autoplay(); | |
| 2144 | + | |
| 2145 | + $this->add_control( | |
| 2146 | + 'layout_slider_loop', | |
| 2147 | + [ | |
| 2148 | + 'label' => esc_html__('Infinite Loop', 'king-addons'), | |
| 2149 | + 'type' => Controls_Manager::SWITCHER, | |
| 2150 | + 'default' => 'yes', | |
| 2151 | + 'separator' => 'before', | |
| 2152 | + 'frontend_available' => true, | |
| 2153 | + 'condition' => [ | |
| 2154 | + 'layout_select' => 'slider', | |
| 2155 | + ], | |
| 2156 | + ] | |
| 2157 | + ); | |
| 2158 | + | |
| 2159 | + $this->add_control( | |
| 2160 | + 'layout_slider_effect', | |
| 2161 | + [ | |
| 2162 | + 'type' => Controls_Manager::SELECT, | |
| 2163 | + 'label' => esc_html__('Effect', 'king-addons'), | |
| 2164 | + 'default' => 'slide', | |
| 2165 | + 'options' => [ | |
| 2166 | + 'slide' => esc_html__('Slide', 'king-addons'), | |
| 2167 | + 'fade' => esc_html__('Fade', 'king-addons'), | |
| 2168 | + ], | |
| 2169 | + 'condition' => [ | |
| 2170 | + 'layout_slider_amount' => 1, | |
| 2171 | + 'layout_select' => 'slider', | |
| 2172 | + ], | |
| 2173 | + ] | |
| 2174 | + ); | |
| 2175 | + | |
| 2176 | + $this->add_control( | |
| 2177 | + 'layout_slider_effect_duration', | |
| 2178 | + [ | |
| 2179 | + 'label' => esc_html__('Effect Duration', 'king-addons'), | |
| 2180 | + 'type' => Controls_Manager::NUMBER, | |
| 2181 | + 'default' => 0.7, | |
| 2182 | + 'min' => 0, | |
| 2183 | + 'max' => 5, | |
| 2184 | + 'step' => 0.1, | |
| 2185 | + 'condition' => [ | |
| 2186 | + 'layout_slider_amount' => 1, | |
| 2187 | + 'layout_select' => 'slider', | |
| 2188 | + ], | |
| 2189 | + ] | |
| 2190 | + ); | |
| 2191 | + | |
| 2192 | + $this->end_controls_section(); | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + $this->start_controls_section( | |
| 2196 | + 'section_grid_elements', | |
| 2197 | + [ | |
| 2198 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Elements', 'king-addons'), | |
| 2199 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 2200 | + ] | |
| 2201 | + ); | |
| 2202 | + | |
| 2203 | + $repeater = new Repeater(); | |
| 2204 | + | |
| 2205 | + $element_select = $this->add_option_element_select(); | |
| 2206 | + | |
| 2207 | + $repeater->add_control( | |
| 2208 | + 'element_select', | |
| 2209 | + [ | |
| 2210 | + 'label' => esc_html__('Select Element', 'king-addons'), | |
| 2211 | + 'type' => Controls_Manager::SELECT, | |
| 2212 | + 'default' => 'title', | |
| 2213 | + 'options' => array_merge($element_select, $post_taxonomies), | |
| 2214 | + 'separator' => 'after' | |
| 2215 | + ] | |
| 2216 | + ); | |
| 2217 | + | |
| 2218 | + $repeater->add_control( | |
| 2219 | + 'show_last_update_date', | |
| 2220 | + [ | |
| 2221 | + 'label' => esc_html__('Show Last Update Date', 'king-addons'), | |
| 2222 | + 'type' => Controls_Manager::SWITCHER, | |
| 2223 | + 'return_value' => 'yes', | |
| 2224 | + 'separator' => 'after', | |
| 2225 | + 'condition' => [ | |
| 2226 | + 'element_select' => 'date', | |
| 2227 | + ] | |
| 2228 | + ] | |
| 2229 | + ); | |
| 2230 | + | |
| 2231 | + Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'grid', 'element_select', ['pro-lk', 'pro-shr', 'pro-cf']); | |
| 2232 | + | |
| 2233 | + $repeater->add_control( | |
| 2234 | + 'element_location', | |
| 2235 | + [ | |
| 2236 | + 'label' => esc_html__('Location', 'king-addons'), | |
| 2237 | + 'type' => Controls_Manager::SELECT, | |
| 2238 | + 'default' => 'below', | |
| 2239 | + 'options' => [ | |
| 2240 | + 'above' => esc_html__('Above Media', 'king-addons'), | |
| 2241 | + 'over' => esc_html__('Over Media', 'king-addons'), | |
| 2242 | + 'below' => esc_html__('Below Media', 'king-addons'), | |
| 2243 | + ] | |
| 2244 | + ] | |
| 2245 | + ); | |
| 2246 | + | |
| 2247 | + $repeater->add_control( | |
| 2248 | + 'element_display', | |
| 2249 | + [ | |
| 2250 | + 'label' => esc_html__('Display', 'king-addons'), | |
| 2251 | + 'type' => Controls_Manager::SELECT, | |
| 2252 | + 'default' => 'block', | |
| 2253 | + 'options' => [ | |
| 2254 | + 'inline' => esc_html__('Inline', 'king-addons'), | |
| 2255 | + 'block' => esc_html__('Separate Line', 'king-addons'), | |
| 2256 | + 'custom' => esc_html__('Custom Width', 'king-addons'), | |
| 2257 | + ], | |
| 2258 | + ] | |
| 2259 | + ); | |
| 2260 | + | |
| 2261 | + $repeater->add_control( | |
| 2262 | + 'element_custom_width', | |
| 2263 | + [ | |
| 2264 | + 'label' => esc_html__('Element Width', 'king-addons'), | |
| 2265 | + 'type' => Controls_Manager::SLIDER, | |
| 2266 | + 'size_units' => ['%'], | |
| 2267 | + 'range' => [ | |
| 2268 | + '%' => [ | |
| 2269 | + 'min' => 0, | |
| 2270 | + 'max' => 100, | |
| 2271 | + ], | |
| 2272 | + ], | |
| 2273 | + 'default' => [ | |
| 2274 | + 'unit' => '%', | |
| 2275 | + 'size' => 100, | |
| 2276 | + ], | |
| 2277 | + 'selectors' => [ | |
| 2278 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}%;', | |
| 2279 | + ], | |
| 2280 | + 'condition' => [ | |
| 2281 | + 'element_display' => 'custom', | |
| 2282 | + ], | |
| 2283 | + ] | |
| 2284 | + ); | |
| 2285 | + | |
| 2286 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 2287 | + $repeater->add_control( | |
| 2288 | + 'element_align_pro_notice', | |
| 2289 | + [ | |
| 2290 | + 'raw' => 'Vertical Align option is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>', | |
| 2291 | + 'type' => Controls_Manager::RAW_HTML, | |
| 2292 | + 'content_classes' => 'king-addons-pro-notice', | |
| 2293 | + 'condition' => [ | |
| 2294 | + 'element_location' => 'over', | |
| 2295 | + ], | |
| 2296 | + ] | |
| 2297 | + ); | |
| 2298 | + } | |
| 2299 | + | |
| 2300 | + $repeater->add_control( | |
| 2301 | + 'element_align_vr', | |
| 2302 | + [ | |
| 2303 | + 'label' => esc_html__('Vertical Align', 'king-addons'), | |
| 2304 | + 'type' => Controls_Manager::CHOOSE, | |
| 2305 | + 'label_block' => false, | |
| 2306 | + 'default' => 'middle', | |
| 2307 | + 'options' => [ | |
| 2308 | + 'top' => [ | |
| 2309 | + 'title' => esc_html__('Top', 'king-addons'), | |
| 2310 | + 'icon' => 'eicon-v-align-top', | |
| 2311 | + ], | |
| 2312 | + 'middle' => [ | |
| 2313 | + 'title' => esc_html__('Middle', 'king-addons'), | |
| 2314 | + 'icon' => 'eicon-v-align-middle', | |
| 2315 | + ], | |
| 2316 | + 'bottom' => [ | |
| 2317 | + 'title' => esc_html__('Bottom', 'king-addons'), | |
| 2318 | + 'icon' => 'eicon-v-align-bottom', | |
| 2319 | + ], | |
| 2320 | + ], | |
| 2321 | + 'condition' => [ | |
| 2322 | + 'element_location' => 'over', | |
| 2323 | + ], | |
| 2324 | + ] | |
| 2325 | + ); | |
| 2326 | + | |
| 2327 | + $repeater->add_control( | |
| 2328 | + 'element_align_hr', | |
| 2329 | + [ | |
| 2330 | + 'label' => esc_html__('Horizontal Align', 'king-addons'), | |
| 2331 | + 'type' => Controls_Manager::CHOOSE, | |
| 2332 | + 'label_block' => false, | |
| 2333 | + 'default' => 'left', | |
| 2334 | + 'options' => [ | |
| 2335 | + 'left' => [ | |
| 2336 | + 'title' => esc_html__('Left', 'king-addons'), | |
| 2337 | + 'icon' => 'eicon-h-align-left', | |
| 2338 | + ], | |
| 2339 | + 'center' => [ | |
| 2340 | + 'title' => esc_html__('Center', 'king-addons'), | |
| 2341 | + 'icon' => 'eicon-h-align-center', | |
| 2342 | + ], | |
| 2343 | + 'right' => [ | |
| 2344 | + 'title' => esc_html__('Right', 'king-addons'), | |
| 2345 | + 'icon' => 'eicon-h-align-right', | |
| 2346 | + ] | |
| 2347 | + ], | |
| 2348 | + 'selectors' => [ | |
| 2349 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => 'text-align: {{VALUE}}', | |
| 2350 | + ], | |
| 2351 | + 'render_type' => 'template', | |
| 2352 | + 'separator' => 'after' | |
| 2353 | + ] | |
| 2354 | + ); | |
| 2355 | + | |
| 2356 | + $repeater->add_control( | |
| 2357 | + 'element_title_tag', | |
| 2358 | + [ | |
| 2359 | + 'label' => esc_html__('Title HTML Tag', 'king-addons'), | |
| 2360 | + 'type' => Controls_Manager::SELECT, | |
| 2361 | + 'options' => [ | |
| 2362 | + 'h1' => 'H1', | |
| 2363 | + 'h2' => 'H2', | |
| 2364 | + 'h3' => 'H3', | |
| 2365 | + 'h4' => 'H4', | |
| 2366 | + 'h5' => 'H5', | |
| 2367 | + 'h6' => 'H6', | |
| 2368 | + 'div' => 'div', | |
| 2369 | + 'span' => 'span', | |
| 2370 | + 'P' => 'p' | |
| 2371 | + ], | |
| 2372 | + 'default' => 'h2', | |
| 2373 | + 'condition' => [ | |
| 2374 | + 'element_select' => 'title', | |
| 2375 | + ] | |
| 2376 | + ] | |
| 2377 | + ); | |
| 2378 | + | |
| 2379 | + $repeater->add_control( | |
| 2380 | + 'element_dropcap', | |
| 2381 | + [ | |
| 2382 | + 'label' => esc_html__('Enable Drop Cap', 'king-addons'), | |
| 2383 | + 'type' => Controls_Manager::SWITCHER, | |
| 2384 | + 'return_value' => 'yes', | |
| 2385 | + 'condition' => [ | |
| 2386 | + 'element_select' => ['content', 'excerpt'], | |
| 2387 | + ] | |
| 2388 | + ] | |
| 2389 | + ); | |
| 2390 | + | |
| 2391 | + $repeater->add_control( | |
| 2392 | + 'element_trim_text_by', | |
| 2393 | + [ | |
| 2394 | + 'label' => esc_html__('Trim Text By', 'king-addons'), | |
| 2395 | + 'type' => Controls_Manager::SELECT, | |
| 2396 | + 'default' => 'word_count', | |
| 2397 | + 'options' => $this->add_repeater_args_element_trim_text_by(), | |
| 2398 | + 'separator' => 'after', | |
| 2399 | + 'condition' => [ | |
| 2400 | + 'element_select' => ['title', 'excerpt'], | |
| 2401 | + ] | |
| 2402 | + ] | |
| 2403 | + ); | |
| 2404 | + | |
| 2405 | + $repeater->add_control( | |
| 2406 | + 'element_word_count', | |
| 2407 | + [ | |
| 2408 | + 'label' => esc_html__('Word Count', 'king-addons'), | |
| 2409 | + 'type' => Controls_Manager::NUMBER, | |
| 2410 | + 'default' => 20, | |
| 2411 | + 'min' => 1, | |
| 2412 | + 'condition' => [ | |
| 2413 | + 'element_select' => ['title', 'excerpt'], | |
| 2414 | + 'element_trim_text_by' => 'word_count' | |
| 2415 | + ] | |
| 2416 | + ] | |
| 2417 | + ); | |
| 2418 | + | |
| 2419 | + $repeater->add_control( | |
| 2420 | + 'element_letter_count', | |
| 2421 | + [ | |
| 2422 | + 'label' => esc_html__('Letter Count', 'king-addons'), | |
| 2423 | + 'type' => Controls_Manager::NUMBER, | |
| 2424 | + 'default' => 40, | |
| 2425 | + 'min' => 1, | |
| 2426 | + 'condition' => [ | |
| 2427 | + 'element_select' => ['title', 'excerpt'], | |
| 2428 | + 'element_trim_text_by' => 'letter_count' | |
| 2429 | + ] | |
| 2430 | + ] | |
| 2431 | + ); | |
| 2432 | + | |
| 2433 | + $repeater->add_control( | |
| 2434 | + 'element_show_avatar', | |
| 2435 | + [ | |
| 2436 | + 'label' => esc_html__('Show Avatar', 'king-addons'), | |
| 2437 | + 'type' => Controls_Manager::SWITCHER, | |
| 2438 | + 'return_value' => 'yes', | |
| 2439 | + 'condition' => [ | |
| 2440 | + 'element_select' => ['author'] | |
| 2441 | + ] | |
| 2442 | + ] | |
| 2443 | + ); | |
| 2444 | + | |
| 2445 | + $repeater->add_control( | |
| 2446 | + 'element_avatar_size', | |
| 2447 | + [ | |
| 2448 | + 'label' => esc_html__('Avatar Size', 'king-addons'), | |
| 2449 | + 'type' => Controls_Manager::NUMBER, | |
| 2450 | + 'default' => 16, | |
| 2451 | + 'min' => 8, | |
| 2452 | + 'condition' => [ | |
| 2453 | + 'element_select' => ['author'], | |
| 2454 | + 'element_show_avatar' => 'yes' | |
| 2455 | + ], | |
| 2456 | + 'separator' => 'after' | |
| 2457 | + ] | |
| 2458 | + ); | |
| 2459 | + | |
| 2460 | + $repeater->add_control( | |
| 2461 | + 'element_read_more_text', | |
| 2462 | + [ | |
| 2463 | + 'label' => esc_html__('Read More Text', 'king-addons'), | |
| 2464 | + 'type' => Controls_Manager::TEXT, | |
| 2465 | + 'dynamic' => [ | |
| 2466 | + 'active' => true, | |
| 2467 | + ], | |
| 2468 | + 'default' => 'Read More', | |
| 2469 | + 'condition' => [ | |
| 2470 | + 'element_select' => ['read-more'], | |
| 2471 | + ], | |
| 2472 | + 'separator' => 'after' | |
| 2473 | + ] | |
| 2474 | + ); | |
| 2475 | + | |
| 2476 | + $repeater->add_control( | |
| 2477 | + 'element_tax_sep', | |
| 2478 | + [ | |
| 2479 | + 'label' => esc_html__('Separator', 'king-addons'), | |
| 2480 | + 'type' => Controls_Manager::TEXT, | |
| 2481 | + 'dynamic' => [ | |
| 2482 | + 'active' => true, | |
| 2483 | + ], | |
| 2484 | + 'default' => ', ', | |
| 2485 | + 'condition' => [ | |
| 2486 | + 'element_select!' => [ | |
| 2487 | + 'title', | |
| 2488 | + 'content', | |
| 2489 | + 'excerpt', | |
| 2490 | + 'date', | |
| 2491 | + 'time', | |
| 2492 | + 'author', | |
| 2493 | + 'comments', | |
| 2494 | + 'read-more', | |
| 2495 | + 'likes', | |
| 2496 | + 'sharing', | |
| 2497 | + 'lightbox', | |
| 2498 | + 'custom-field', | |
| 2499 | + 'separator', | |
| 2500 | + 'post_format', | |
| 2501 | + ], | |
| 2502 | + ], | |
| 2503 | + 'separator' => 'after' | |
| 2504 | + ] | |
| 2505 | + ); | |
| 2506 | + | |
| 2507 | + $repeater->add_control( | |
| 2508 | + 'element_tax_style', | |
| 2509 | + [ | |
| 2510 | + 'label' => esc_html__('Select Styling', 'king-addons'), | |
| 2511 | + 'type' => Controls_Manager::SELECT, | |
| 2512 | + 'default' => 'king-addons-grid-tax-style-1', | |
| 2513 | + 'options' => [ | |
| 2514 | + 'king-addons-grid-tax-style-1' => esc_html__('Taxonomy Style 1', 'king-addons'), | |
| 2515 | + 'king-addons-grid-tax-style-2' => esc_html__('Taxonomy Style 2', 'king-addons'), | |
| 2516 | + ], | |
| 2517 | + 'condition' => [ | |
| 2518 | + 'element_select!' => [ | |
| 2519 | + 'title', | |
| 2520 | + 'content', | |
| 2521 | + 'excerpt', | |
| 2522 | + 'date', | |
| 2523 | + 'time', | |
| 2524 | + 'author', | |
| 2525 | + 'comments', | |
| 2526 | + 'read-more', | |
| 2527 | + 'likes', | |
| 2528 | + 'sharing', | |
| 2529 | + 'lightbox', | |
| 2530 | + 'custom-field', | |
| 2531 | + 'separator', | |
| 2532 | + ], | |
| 2533 | + ], | |
| 2534 | + 'separator' => 'after' | |
| 2535 | + ] | |
| 2536 | + ); | |
| 2537 | + | |
| 2538 | + $repeater->add_control( | |
| 2539 | + 'element_comments_text_1', | |
| 2540 | + [ | |
| 2541 | + 'label' => esc_html__('No Comments', 'king-addons'), | |
| 2542 | + 'type' => Controls_Manager::TEXT, | |
| 2543 | + 'dynamic' => [ | |
| 2544 | + 'active' => true, | |
| 2545 | + ], | |
| 2546 | + 'default' => 'No Comments', | |
| 2547 | + 'condition' => [ | |
| 2548 | + 'element_select' => ['comments'], | |
| 2549 | + ] | |
| 2550 | + ] | |
| 2551 | + ); | |
| 2552 | + | |
| 2553 | + $repeater->add_control( | |
| 2554 | + 'element_comments_text_2', | |
| 2555 | + [ | |
| 2556 | + 'label' => esc_html__('One Comment', 'king-addons'), | |
| 2557 | + 'type' => Controls_Manager::TEXT, | |
| 2558 | + 'dynamic' => [ | |
| 2559 | + 'active' => true, | |
| 2560 | + ], | |
| 2561 | + 'default' => 'Comment', | |
| 2562 | + 'condition' => [ | |
| 2563 | + 'element_select' => ['comments'], | |
| 2564 | + ] | |
| 2565 | + ] | |
| 2566 | + ); | |
| 2567 | + | |
| 2568 | + $repeater->add_control( | |
| 2569 | + 'element_comments_text_3', | |
| 2570 | + [ | |
| 2571 | + 'label' => esc_html__('Multiple Comments', 'king-addons'), | |
| 2572 | + 'type' => Controls_Manager::TEXT, | |
| 2573 | + 'dynamic' => [ | |
| 2574 | + 'active' => true, | |
| 2575 | + ], | |
| 2576 | + 'default' => 'Comments', | |
| 2577 | + 'condition' => [ | |
| 2578 | + 'element_select' => ['comments'], | |
| 2579 | + ], | |
| 2580 | + 'separator' => 'after' | |
| 2581 | + ] | |
| 2582 | + ); | |
| 2583 | + | |
| 2584 | + $repeater->add_control('element_like_icon', $this->add_repeater_args_element_like_icon()); | |
| 2585 | + | |
| 2586 | + $repeater->add_control('element_like_show_count', $this->add_repeater_args_element_like_show_count()); | |
| 2587 | + | |
| 2588 | + $repeater->add_control('element_like_text', $this->add_repeater_args_element_like_text()); | |
| 2589 | + | |
| 2590 | + $repeater->add_control('element_sharing_icon_1', $this->add_repeater_args_element_sharing_icon_1()); | |
| 2591 | + | |
| 2592 | + $repeater->add_control('element_sharing_icon_2', $this->add_repeater_args_element_sharing_icon_2()); | |
| 2593 | + | |
| 2594 | + $repeater->add_control('element_sharing_icon_3', $this->add_repeater_args_element_sharing_icon_3()); | |
| 2595 | + | |
| 2596 | + $repeater->add_control('element_sharing_icon_4', $this->add_repeater_args_element_sharing_icon_4()); | |
| 2597 | + | |
| 2598 | + $repeater->add_control('element_sharing_icon_5', $this->add_repeater_args_element_sharing_icon_5()); | |
| 2599 | + | |
| 2600 | + $repeater->add_control('element_sharing_icon_6', $this->add_repeater_args_element_sharing_icon_6()); | |
| 2601 | + | |
| 2602 | + $repeater->add_control('element_sharing_trigger', $this->add_repeater_args_element_sharing_trigger()); | |
| 2603 | + | |
| 2604 | + $repeater->add_control('element_sharing_trigger_icon', $this->add_repeater_args_element_sharing_trigger_icon()); | |
| 2605 | + | |
| 2606 | + $repeater->add_control('element_sharing_trigger_action', $this->add_repeater_args_element_sharing_trigger_action()); | |
| 2607 | + | |
| 2608 | + $repeater->add_control('element_sharing_trigger_direction', $this->add_repeater_args_element_sharing_trigger_direction()); | |
| 2609 | + | |
| 2610 | + $repeater->add_control('element_sharing_tooltip', $this->add_repeater_args_element_sharing_tooltip()); | |
| 2611 | + | |
| 2612 | + $repeater->add_control( | |
| 2613 | + 'element_lightbox_pfa_select', | |
| 2614 | + [ | |
| 2615 | + 'label' => esc_html__('Post Format Audio', 'king-addons'), | |
| 2616 | + 'type' => Controls_Manager::SELECT, | |
| 2617 | + 'default' => 'default', | |
| 2618 | + 'options' => [ | |
| 2619 | + 'default' => esc_html__('Default', 'king-addons'), | |
| 2620 | + 'meta' => esc_html__('Meta Value', 'king-addons'), | |
| 2621 | + ], | |
| 2622 | + 'condition' => [ | |
| 2623 | + 'element_select' => 'lightbox', | |
| 2624 | + ], | |
| 2625 | + ] | |
| 2626 | + ); | |
| 2627 | + | |
| 2628 | + $repeater->add_control( | |
| 2629 | + 'element_lightbox_pfa_meta', | |
| 2630 | + [ | |
| 2631 | + 'label' => esc_html__('Audio Meta Value', 'king-addons'), | |
| 2632 | + 'type' => 'king-addons-ajax-select2', | |
| 2633 | + 'label_block' => true, | |
| 2634 | + 'default' => 'default', | |
| 2635 | + 'options' => 'ajaxselect2/getCustomMetaKeys', | |
| 2636 | + 'condition' => [ | |
| 2637 | + 'element_select' => 'lightbox', | |
| 2638 | + 'element_lightbox_pfa_select' => 'meta', | |
| 2639 | + ], | |
| 2640 | + ] | |
| 2641 | + ); | |
| 2642 | + | |
| 2643 | + $repeater->add_control( | |
| 2644 | + 'element_lightbox_pfv_select', | |
| 2645 | + [ | |
| 2646 | + 'label' => esc_html__('Post Format Video', 'king-addons'), | |
| 2647 | + 'type' => Controls_Manager::SELECT, | |
| 2648 | + 'default' => 'default', | |
| 2649 | + 'options' => [ | |
| 2650 | + 'default' => esc_html__('Default', 'king-addons'), | |
| 2651 | + 'meta' => esc_html__('Meta Value', 'king-addons'), | |
| 2652 | + ], | |
| 2653 | + 'condition' => [ | |
| 2654 | + 'element_select' => 'lightbox', | |
| 2655 | + ], | |
| 2656 | + ] | |
| 2657 | + ); | |
| 2658 | + | |
| 2659 | + $repeater->add_control( | |
| 2660 | + 'element_lightbox_pfv_meta', | |
| 2661 | + [ | |
| 2662 | + 'label' => esc_html__('Video Meta Value', 'king-addons'), | |
| 2663 | + 'type' => 'king-addons-ajax-select2', | |
| 2664 | + 'label_block' => true, | |
| 2665 | + 'default' => 'default', | |
| 2666 | + 'options' => 'ajaxselect2/getCustomMetaKeys', | |
| 2667 | + 'condition' => [ | |
| 2668 | + 'element_select' => 'lightbox', | |
| 2669 | + 'element_lightbox_pfv_select' => 'meta', | |
| 2670 | + ], | |
| 2671 | + ] | |
| 2672 | + ); | |
| 2673 | + | |
| 2674 | + $repeater->add_control( | |
| 2675 | + 'element_lightbox_overlay', | |
| 2676 | + [ | |
| 2677 | + 'label' => esc_html__('Media Overlay', 'king-addons'), | |
| 2678 | + 'type' => Controls_Manager::SWITCHER, | |
| 2679 | + 'return_value' => 'yes', | |
| 2680 | + 'separator' => 'after', | |
| 2681 | + 'condition' => [ | |
| 2682 | + 'element_select' => ['lightbox'], | |
| 2683 | + ], | |
| 2684 | + ] | |
| 2685 | + ); | |
| 2686 | + | |
| 2687 | + $repeater->add_control('element_custom_field', $this->add_repeater_args_element_custom_field()); | |
| 2688 | + | |
| 2689 | + $repeater->add_control('element_custom_field_img_ID', $this->add_repeater_args_element_custom_field_img_ID()); | |
| 2690 | + | |
| 2691 | + $repeater->add_control('element_custom_field_btn_link', $this->add_repeater_args_element_custom_field_btn_link()); | |
| 2692 | + | |
| 2693 | + $repeater->add_control('element_custom_field_new_tab', $this->add_repeater_args_element_custom_field_new_tab()); | |
| 2694 | + | |
| 2695 | + $repeater->add_control('custom_field_wrapper_html_divider1', $this->add_repeater_args_custom_field_wrapper_html_divider1()); | |
| 2696 | + | |
| 2697 | + $repeater->add_control('element_custom_field_wrapper', $this->add_repeater_args_element_custom_field_wrapper()); | |
| 2698 | + | |
| 2699 | + $repeater->add_control('element_custom_field_wrapper_html', $this->add_repeater_args_element_custom_field_wrapper_html()); | |
| 2700 | + | |
| 2701 | + $repeater->add_control('custom_field_wrapper_html_divider2', $this->add_repeater_args_custom_field_wrapper_html_divider2()); | |
| 2702 | + | |
| 2703 | + $repeater->add_control('element_cf_tag', $this->add_repeater_args_element_cf_tag()); | |
| 2704 | + | |
| 2705 | + $repeater->add_control('element_custom_field_style', $this->add_repeater_args_element_custom_field_style()); | |
| 2706 | + | |
| 2707 | + $repeater->add_control( | |
| 2708 | + 'element_separator_style', | |
| 2709 | + [ | |
| 2710 | + 'label' => esc_html__('Select Styling', 'king-addons'), | |
| 2711 | + 'type' => Controls_Manager::SELECT, | |
| 2712 | + 'default' => 'king-addons-grid-sep-style-1', | |
| 2713 | + 'options' => [ | |
| 2714 | + 'king-addons-grid-sep-style-1' => esc_html__('Separator Style 1', 'king-addons'), | |
| 2715 | + 'king-addons-grid-sep-style-2' => esc_html__('Separator Style 2', 'king-addons'), | |
| 2716 | + ], | |
| 2717 | + 'condition' => [ | |
| 2718 | + 'element_select' => 'separator', | |
| 2719 | + ] | |
| 2720 | + ] | |
| 2721 | + ); | |
| 2722 | + | |
| 2723 | + $repeater->add_control( | |
| 2724 | + 'element_extra_text_pos', | |
| 2725 | + [ | |
| 2726 | + 'label' => esc_html__('Extra Text Display', 'king-addons'), | |
| 2727 | + 'type' => Controls_Manager::SELECT, | |
| 2728 | + 'options' => [ | |
| 2729 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2730 | + 'before' => esc_html__('Before Element', 'king-addons'), | |
| 2731 | + 'after' => esc_html__('After Element', 'king-addons'), | |
| 2732 | + ], | |
| 2733 | + 'default' => 'none', | |
| 2734 | + 'condition' => [ | |
| 2735 | + 'element_select!' => [ | |
| 2736 | + 'title', | |
| 2737 | + 'content', | |
| 2738 | + 'excerpt', | |
| 2739 | + 'read-more', | |
| 2740 | + 'separator', | |
| 2741 | + ], | |
| 2742 | + ] | |
| 2743 | + ] | |
| 2744 | + ); | |
| 2745 | + | |
| 2746 | + $repeater->add_control( | |
| 2747 | + 'element_extra_text', | |
| 2748 | + [ | |
| 2749 | + 'label' => esc_html__('Extra Text', 'king-addons'), | |
| 2750 | + 'type' => Controls_Manager::TEXT, | |
| 2751 | + 'dynamic' => [ | |
| 2752 | + 'active' => true, | |
| 2753 | + ], | |
| 2754 | + 'default' => '', | |
| 2755 | + 'condition' => [ | |
| 2756 | + 'element_select!' => [ | |
| 2757 | + 'title', | |
| 2758 | + 'content', | |
| 2759 | + 'excerpt', | |
| 2760 | + 'read-more', | |
| 2761 | + 'separator', | |
| 2762 | + ], | |
| 2763 | + 'element_extra_text_pos!' => 'none' | |
| 2764 | + ] | |
| 2765 | + ] | |
| 2766 | + ); | |
| 2767 | + | |
| 2768 | + $repeater->add_control( | |
| 2769 | + 'element_extra_icon_pos', | |
| 2770 | + [ | |
| 2771 | + 'label' => esc_html__('Extra Icon Position', 'king-addons'), | |
| 2772 | + 'type' => Controls_Manager::SELECT, | |
| 2773 | + 'options' => [ | |
| 2774 | + 'none' => esc_html__('None', 'king-addons'), | |
| 2775 | + 'before' => esc_html__('Before Element', 'king-addons'), | |
| 2776 | + 'after' => esc_html__('After Element', 'king-addons'), | |
| 2777 | + ], | |
| 2778 | + 'default' => 'none', | |
| 2779 | + 'condition' => [ | |
| 2780 | + 'element_select!' => [ | |
| 2781 | + 'title', | |
| 2782 | + 'content', | |
| 2783 | + 'excerpt', | |
| 2784 | + 'separator', | |
| 2785 | + 'likes', | |
| 2786 | + 'sharing', | |
| 2787 | + ], | |
| 2788 | + ] | |
| 2789 | + ] | |
| 2790 | + ); | |
| 2791 | + | |
| 2792 | + $repeater->add_control( | |
| 2793 | + 'element_extra_icon', | |
| 2794 | + [ | |
| 2795 | + 'label' => esc_html__('Select Icon', 'king-addons'), | |
| 2796 | + 'type' => Controls_Manager::ICONS, | |
| 2797 | + 'skin' => 'inline', | |
| 2798 | + 'label_block' => false, | |
| 2799 | + 'default' => [ | |
| 2800 | + 'value' => 'fas fa-search', | |
| 2801 | + 'library' => 'fa-solid', | |
| 2802 | + ], | |
| 2803 | + 'condition' => [ | |
| 2804 | + 'element_select!' => [ | |
| 2805 | + 'title', | |
| 2806 | + 'content', | |
| 2807 | + 'excerpt', | |
| 2808 | + 'separator', | |
| 2809 | + 'likes', | |
| 2810 | + 'sharing', | |
| 2811 | + ], | |
| 2812 | + 'element_extra_icon_pos!' => 'none' | |
| 2813 | + ] | |
| 2814 | + ] | |
| 2815 | + ); | |
| 2816 | + | |
| 2817 | + $repeater->add_control( | |
| 2818 | + 'animation_divider', | |
| 2819 | + [ | |
| 2820 | + 'type' => Controls_Manager::DIVIDER, | |
| 2821 | + 'style' => 'thick', | |
| 2822 | + 'condition' => [ | |
| 2823 | + 'element_location' => 'over' | |
| 2824 | + ], | |
| 2825 | + ] | |
| 2826 | + ); | |
| 2827 | + | |
| 2828 | + $repeater->add_control( | |
| 2829 | + 'element_animation', | |
| 2830 | + [ | |
| 2831 | + 'label' => esc_html__('Select Animation', 'king-addons'), | |
| 2832 | + 'type' => 'king-addons-animations', | |
| 2833 | + 'default' => 'none', | |
| 2834 | + 'condition' => [ | |
| 2835 | + 'element_location' => 'over' | |
| 2836 | + ], | |
| 2837 | + ] | |
| 2838 | + ); | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, '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']); | |
| 2842 | + | |
| 2843 | + $repeater->add_control( | |
| 2844 | + 'element_animation_duration', | |
| 2845 | + [ | |
| 2846 | + 'label' => esc_html__('Animation Duration', 'king-addons'), | |
| 2847 | + 'type' => Controls_Manager::NUMBER, | |
| 2848 | + 'default' => 0.3, | |
| 2849 | + 'min' => 0, | |
| 2850 | + 'max' => 5, | |
| 2851 | + 'step' => 0.1, | |
| 2852 | + 'selectors' => [ | |
| 2853 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => 'transition-duration: {{VALUE}}s;' | |
| 2854 | + ], | |
| 2855 | + 'condition' => [ | |
| 2856 | + 'element_animation!' => 'none', | |
| 2857 | + 'element_location' => 'over', | |
| 2858 | + ], | |
| 2859 | + ] | |
| 2860 | + ); | |
| 2861 | + | |
| 2862 | + $repeater->add_control( | |
| 2863 | + 'element_animation_delay', | |
| 2864 | + [ | |
| 2865 | + 'label' => esc_html__('Animation Delay', 'king-addons'), | |
| 2866 | + 'type' => Controls_Manager::NUMBER, | |
| 2867 | + 'default' => 0, | |
| 2868 | + 'min' => 0, | |
| 2869 | + 'max' => 5, | |
| 2870 | + 'step' => 0.1, | |
| 2871 | + 'selectors' => [ | |
| 2872 | + '{{WRAPPER}} .king-addons-animation-wrap:hover {{CURRENT_ITEM}}' => 'transition-delay: {{VALUE}}s;' | |
| 2873 | + ], | |
| 2874 | + 'condition' => [ | |
| 2875 | + 'element_animation!' => 'none', | |
| 2876 | + 'element_location' => 'over' | |
| 2877 | + ], | |
| 2878 | + ] | |
| 2879 | + ); | |
| 2880 | + | |
| 2881 | + $repeater->add_control( | |
| 2882 | + 'element_animation_timing', | |
| 2883 | + [ | |
| 2884 | + 'label' => esc_html__('Animation Timing', 'king-addons'), | |
| 2885 | + 'type' => Controls_Manager::SELECT, | |
| 2886 | + 'options' => Core::getAnimationTimings(), | |
| 2887 | + 'default' => 'ease-default', | |
| 2888 | + 'condition' => [ | |
| 2889 | + 'element_animation!' => 'none', | |
| 2890 | + 'element_location' => 'over' | |
| 2891 | + ], | |
| 2892 | + ] | |
| 2893 | + ); | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, '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',]); | |
| 2897 | + | |
| 2898 | + $repeater->add_control( | |
| 2899 | + 'element_animation_size', | |
| 2900 | + [ | |
| 2901 | + 'label' => esc_html__('Animation Size', 'king-addons'), | |
| 2902 | + 'type' => Controls_Manager::SELECT, | |
| 2903 | + 'options' => [ | |
| 2904 | + 'small' => esc_html__('Small', 'king-addons'), | |
| 2905 | + 'medium' => esc_html__('Medium', 'king-addons'), | |
| 2906 | + 'large' => esc_html__('Large', 'king-addons'), | |
| 2907 | + ], | |
| 2908 | + 'default' => 'large', | |
| 2909 | + 'condition' => [ | |
| 2910 | + 'element_animation!' => 'none', | |
| 2911 | + 'element_location' => 'over' | |
| 2912 | + ], | |
| 2913 | + ] | |
| 2914 | + ); | |
| 2915 | + | |
| 2916 | + $repeater->add_control( | |
| 2917 | + 'element_animation_tr', | |
| 2918 | + [ | |
| 2919 | + 'label' => esc_html__('Animation Transparency', 'king-addons'), | |
| 2920 | + 'type' => Controls_Manager::SWITCHER, | |
| 2921 | + 'default' => 'yes', | |
| 2922 | + 'return_value' => 'yes', | |
| 2923 | + 'condition' => [ | |
| 2924 | + 'element_animation!' => 'none', | |
| 2925 | + 'element_location' => 'over' | |
| 2926 | + ], | |
| 2927 | + ] | |
| 2928 | + ); | |
| 2929 | + | |
| 2930 | + $repeater->add_control( | |
| 2931 | + 'element_animation_disable_mobile', | |
| 2932 | + [ | |
| 2933 | + 'label' => esc_html__('Disable on Mobile/Tablet', 'king-addons'), | |
| 2934 | + 'type' => Controls_Manager::SWITCHER, | |
| 2935 | + 'return_value' => 'yes', | |
| 2936 | + 'condition' => [ | |
| 2937 | + 'element_animation!' => 'none', | |
| 2938 | + 'element_location' => 'over' | |
| 2939 | + ], | |
| 2940 | + ] | |
| 2941 | + ); | |
| 2942 | + | |
| 2943 | + $repeater->add_responsive_control( | |
| 2944 | + 'element_show_on', | |
| 2945 | + [ | |
| 2946 | + 'label' => esc_html__('Show on this Device', 'king-addons'), | |
| 2947 | + 'type' => Controls_Manager::SWITCHER, | |
| 2948 | + 'default' => 'yes', | |
| 2949 | + 'widescreen_default' => 'yes', | |
| 2950 | + 'laptop_default' => 'yes', | |
| 2951 | + 'tablet_extra_default' => 'yes', | |
| 2952 | + 'tablet_default' => 'yes', | |
| 2953 | + 'mobile_extra_default' => 'yes', | |
| 2954 | + 'mobile_default' => 'yes', | |
| 2955 | + 'selectors_dictionary' => [ | |
| 2956 | + '' => 'position: absolute; left: -99999999px;', | |
| 2957 | + 'yes' => 'position: static; left: auto;' | |
| 2958 | + ], | |
| 2959 | + 'selectors' => [ | |
| 2960 | + '{{WRAPPER}} {{CURRENT_ITEM}}' => '{{VALUE}}', | |
| 2961 | + ], | |
| 2962 | + 'render_type' => 'template', | |
| 2963 | + ] | |
| 2964 | + ); | |
| 2965 | + | |
| 2966 | + $this->add_control( | |
| 2967 | + 'grid_elements', | |
| 2968 | + [ | |
| 2969 | + 'label' => esc_html__('Grid Elements', 'king-addons'), | |
| 2970 | + 'type' => Controls_Manager::REPEATER, | |
| 2971 | + 'fields' => $repeater->get_controls(), | |
| 2972 | + 'default' => [ | |
| 2973 | + [ | |
| 2974 | + 'element_select' => 'title', | |
| 2975 | + ], | |
| 2976 | + [ | |
| 2977 | + 'element_select' => 'date', | |
| 2978 | + 'element_display' => 'inline', | |
| 2979 | + 'element_extra_text_pos' => 'after', | |
| 2980 | + 'element_extra_text' => '/', | |
| 2981 | + ], | |
| 2982 | + [ | |
| 2983 | + 'element_select' => 'comments', | |
| 2984 | + 'element_display' => 'inline', | |
| 2985 | + ], | |
| 2986 | + [ | |
| 2987 | + 'element_select' => 'excerpt', | |
| 2988 | + ], | |
| 2989 | + [ | |
| 2990 | + 'element_select' => 'read-more', | |
| 2991 | + ], | |
| 2992 | + ], | |
| 2993 | + 'title_field' => '{{ element_select.charAt(0).toUpperCase() + element_select.slice(1) }}', | |
| 2994 | + ] | |
| 2995 | + ); | |
| 2996 | + | |
| 2997 | + $this->end_controls_section(); | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + $this->start_controls_section( | |
| 3001 | + 'section_image_overlay', | |
| 3002 | + [ | |
| 3003 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'), | |
| 3004 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 3005 | + ] | |
| 3006 | + ); | |
| 3007 | + | |
| 3008 | + $this->add_responsive_control( | |
| 3009 | + 'overlay_width', | |
| 3010 | + [ | |
| 3011 | + 'label' => esc_html__('Overlay Width', 'king-addons'), | |
| 3012 | + 'type' => Controls_Manager::SLIDER, | |
| 3013 | + 'size_units' => ['%', 'px'], | |
| 3014 | + 'default' => [ | |
| 3015 | + 'unit' => '%', | |
| 3016 | + 'size' => 100, | |
| 3017 | + ], | |
| 3018 | + 'range' => [ | |
| 3019 | + '%' => [ | |
| 3020 | + 'min' => 0, | |
| 3021 | + 'max' => 100, | |
| 3022 | + ], | |
| 3023 | + 'px' => [ | |
| 3024 | + 'min' => 0, | |
| 3025 | + 'max' => 500, | |
| 3026 | + ], | |
| 3027 | + ], | |
| 3028 | + 'selectors' => [ | |
| 3029 | + '{{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);', | |
| 3030 | + '{{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);', | |
| 3031 | + '{{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);', | |
| 3032 | + '{{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);', | |
| 3033 | + '{{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);', | |
| 3034 | + ], | |
| 3035 | + ] | |
| 3036 | + ); | |
| 3037 | + | |
| 3038 | + $this->add_responsive_control( | |
| 3039 | + 'overlay_height', | |
| 3040 | + [ | |
| 3041 | + 'label' => esc_html__('Overlay Height', 'king-addons'), | |
| 3042 | + 'type' => Controls_Manager::SLIDER, | |
| 3043 | + 'size_units' => ['%', 'px'], | |
| 3044 | + 'default' => [ | |
| 3045 | + 'unit' => '%', | |
| 3046 | + 'size' => 100, | |
| 3047 | + ], | |
| 3048 | + 'range' => [ | |
| 3049 | + '%' => [ | |
| 3050 | + 'min' => 0, | |
| 3051 | + 'max' => 100, | |
| 3052 | + ], | |
| 3053 | + 'px' => [ | |
| 3054 | + 'min' => 0, | |
| 3055 | + 'max' => 500, | |
| 3056 | + ], | |
| 3057 | + ], | |
| 3058 | + 'selectors' => [ | |
| 3059 | + '{{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);', | |
| 3060 | + '{{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);', | |
| 3061 | + '{{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);', | |
| 3062 | + '{{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);', | |
| 3063 | + '{{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);', | |
| 3064 | + ], | |
| 3065 | + 'separator' => 'after', | |
| 3066 | + ] | |
| 3067 | + ); | |
| 3068 | + | |
| 3069 | + $this->add_control( | |
| 3070 | + 'overlay_post_link', | |
| 3071 | + [ | |
| 3072 | + 'label' => esc_html__('Link to Single Page', 'king-addons'), | |
| 3073 | + 'type' => Controls_Manager::SWITCHER, | |
| 3074 | + 'default' => 'yes', | |
| 3075 | + 'return_value' => 'yes', | |
| 3076 | + 'separator' => 'after', | |
| 3077 | + ] | |
| 3078 | + ); | |
| 3079 | + | |
| 3080 | + $this->add_control( | |
| 3081 | + 'overlay_animation', | |
| 3082 | + [ | |
| 3083 | + 'label' => esc_html__('Select Animation', 'king-addons'), | |
| 3084 | + 'type' => 'king-addons-animations-alt', | |
| 3085 | + 'default' => 'fade-in', | |
| 3086 | + ] | |
| 3087 | + ); | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, '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']); | |
| 3091 | + | |
| 3092 | + $this->add_control( | |
| 3093 | + 'overlay_animation_duration', | |
| 3094 | + [ | |
| 3095 | + 'label' => esc_html__('Animation Duration', 'king-addons'), | |
| 3096 | + 'type' => Controls_Manager::NUMBER, | |
| 3097 | + 'default' => 0.3, | |
| 3098 | + 'min' => 0, | |
| 3099 | + 'max' => 5, | |
| 3100 | + 'step' => 0.1, | |
| 3101 | + 'selectors' => [ | |
| 3102 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'transition-duration: {{VALUE}}s;' | |
| 3103 | + ], | |
| 3104 | + 'condition' => [ | |
| 3105 | + 'overlay_animation!' => 'none', | |
| 3106 | + ], | |
| 3107 | + ] | |
| 3108 | + ); | |
| 3109 | + | |
| 3110 | + $this->add_control( | |
| 3111 | + 'overlay_animation_delay', | |
| 3112 | + [ | |
| 3113 | + 'label' => esc_html__('Animation Delay', 'king-addons'), | |
| 3114 | + 'type' => Controls_Manager::NUMBER, | |
| 3115 | + 'default' => 0, | |
| 3116 | + 'min' => 0, | |
| 3117 | + 'max' => 5, | |
| 3118 | + 'step' => 0.1, | |
| 3119 | + 'selectors' => [ | |
| 3120 | + '{{WRAPPER}} .king-addons-animation-wrap:hover .king-addons-grid-media-hover-bg' => 'transition-delay: {{VALUE}}s;' | |
| 3121 | + ], | |
| 3122 | + 'condition' => [ | |
| 3123 | + 'overlay_animation!' => 'none', | |
| 3124 | + ], | |
| 3125 | + ] | |
| 3126 | + ); | |
| 3127 | + | |
| 3128 | + $this->add_control( | |
| 3129 | + 'overlay_animation_timing', | |
| 3130 | + [ | |
| 3131 | + 'label' => esc_html__('Animation Timing', 'king-addons'), | |
| 3132 | + 'type' => Controls_Manager::SELECT, | |
| 3133 | + 'options' => Core::getAnimationTimings(), | |
| 3134 | + 'default' => 'ease-default', | |
| 3135 | + 'condition' => [ | |
| 3136 | + 'overlay_animation!' => 'none', | |
| 3137 | + ], | |
| 3138 | + ] | |
| 3139 | + ); | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'overlay_animation_timing', Core::getAnimationTimingsConditionsPro()); | |
| 3143 | + | |
| 3144 | + $this->add_control( | |
| 3145 | + 'overlay_animation_size', | |
| 3146 | + [ | |
| 3147 | + 'label' => esc_html__('Animation Size', 'king-addons'), | |
| 3148 | + 'type' => Controls_Manager::SELECT, | |
| 3149 | + 'options' => [ | |
| 3150 | + 'small' => esc_html__('Small', 'king-addons'), | |
| 3151 | + 'medium' => esc_html__('Medium', 'king-addons'), | |
| 3152 | + 'large' => esc_html__('Large', 'king-addons'), | |
| 3153 | + ], | |
| 3154 | + 'default' => 'large', | |
| 3155 | + 'condition' => [ | |
| 3156 | + 'overlay_animation!' => 'none', | |
| 3157 | + ], | |
| 3158 | + ] | |
| 3159 | + ); | |
| 3160 | + | |
| 3161 | + $this->add_control( | |
| 3162 | + 'overlay_animation_tr', | |
| 3163 | + [ | |
| 3164 | + 'label' => esc_html__('Animation Transparency', 'king-addons'), | |
| 3165 | + 'type' => Controls_Manager::SWITCHER, | |
| 3166 | + 'default' => 'yes', | |
| 3167 | + 'return_value' => 'yes', | |
| 3168 | + 'condition' => [ | |
| 3169 | + 'overlay_animation!' => 'none', | |
| 3170 | + ], | |
| 3171 | + ] | |
| 3172 | + ); | |
| 3173 | + | |
| 3174 | + $this->add_control_overlay_animation_divider(); | |
| 3175 | + | |
| 3176 | + $this->add_control_overlay_image(); | |
| 3177 | + | |
| 3178 | + $this->add_control_overlay_image_width(); | |
| 3179 | + | |
| 3180 | + $this->end_controls_section(); | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + $this->start_controls_section( | |
| 3184 | + 'section_image_effects', | |
| 3185 | + [ | |
| 3186 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Image Effects', 'king-addons'), | |
| 3187 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 3188 | + ] | |
| 3189 | + ); | |
| 3190 | + | |
| 3191 | + $this->add_control_secondary_img_on_hover(); | |
| 3192 | + | |
| 3193 | + $this->add_control_image_effects(); | |
| 3194 | + | |
| 3195 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'image_effects', ['pro-zi', 'pro-zo', 'pro-go', 'pro-bo']); | |
| 3196 | + | |
| 3197 | + $this->add_control( | |
| 3198 | + 'image_effects_duration', | |
| 3199 | + [ | |
| 3200 | + 'label' => esc_html__('Animation Duration', 'king-addons'), | |
| 3201 | + 'type' => Controls_Manager::NUMBER, | |
| 3202 | + 'default' => 0.5, | |
| 3203 | + 'min' => 0, | |
| 3204 | + 'max' => 5, | |
| 3205 | + 'step' => 0.1, | |
| 3206 | + 'selectors' => [ | |
| 3207 | + '{{WRAPPER}} .king-addons-grid-media-wrap img' => 'transition-duration: {{VALUE}}s;' | |
| 3208 | + ], | |
| 3209 | + 'condition' => [ | |
| 3210 | + 'image_effects!' => 'none', | |
| 3211 | + ], | |
| 3212 | + ] | |
| 3213 | + ); | |
| 3214 | + | |
| 3215 | + $this->add_control( | |
| 3216 | + 'image_effects_delay', | |
| 3217 | + [ | |
| 3218 | + 'label' => esc_html__('Animation Delay', 'king-addons'), | |
| 3219 | + 'type' => Controls_Manager::NUMBER, | |
| 3220 | + 'default' => 0, | |
| 3221 | + 'min' => 0, | |
| 3222 | + 'max' => 5, | |
| 3223 | + 'step' => 0.1, | |
| 3224 | + 'selectors' => [ | |
| 3225 | + '{{WRAPPER}} .king-addons-grid-media-wrap:hover img' => 'transition-delay: {{VALUE}}s;' | |
| 3226 | + ], | |
| 3227 | + 'condition' => [ | |
| 3228 | + 'image_effects!' => 'none', | |
| 3229 | + ], | |
| 3230 | + ] | |
| 3231 | + ); | |
| 3232 | + | |
| 3233 | + $this->add_control( | |
| 3234 | + 'image_effects_animation_timing', | |
| 3235 | + [ | |
| 3236 | + 'label' => esc_html__('Animation Timing', 'king-addons'), | |
| 3237 | + 'type' => Controls_Manager::SELECT, | |
| 3238 | + 'options' => Core::getAnimationTimings(), | |
| 3239 | + 'default' => 'ease-default', | |
| 3240 | + 'condition' => [ | |
| 3241 | + 'image_effects!' => 'none', | |
| 3242 | + ], | |
| 3243 | + ] | |
| 3244 | + ); | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'image_effects_animation_timing', Core::getAnimationTimingsConditionsPro()); | |
| 3248 | + | |
| 3249 | + $this->add_control( | |
| 3250 | + 'image_effects_size', | |
| 3251 | + [ | |
| 3252 | + 'label' => esc_html__('Animation Size', 'king-addons'), | |
| 3253 | + 'type' => Controls_Manager::SELECT, | |
| 3254 | + 'options' => [ | |
| 3255 | + 'small' => esc_html__('Small', 'king-addons'), | |
| 3256 | + 'medium' => esc_html__('Medium', 'king-addons'), | |
| 3257 | + 'large' => esc_html__('Large', 'king-addons'), | |
| 3258 | + ], | |
| 3259 | + 'default' => 'medium', | |
| 3260 | + 'condition' => [ | |
| 3261 | + 'image_effects!' => ['none', 'slide'], | |
| 3262 | + ] | |
| 3263 | + ] | |
| 3264 | + ); | |
| 3265 | + | |
| 3266 | + $this->add_control( | |
| 3267 | + 'image_effects_direction', | |
| 3268 | + [ | |
| 3269 | + 'label' => esc_html__('Animation Direction', 'king-addons'), | |
| 3270 | + 'type' => Controls_Manager::SELECT, | |
| 3271 | + 'options' => [ | |
| 3272 | + 'top' => esc_html__('Top', 'king-addons'), | |
| 3273 | + 'right' => esc_html__('Right', 'king-addons'), | |
| 3274 | + 'bottom' => esc_html__('Bottom', 'king-addons'), | |
| 3275 | + 'left' => esc_html__('Left', 'king-addons'), | |
| 3276 | + ], | |
| 3277 | + 'default' => 'bottom', | |
| 3278 | + 'condition' => [ | |
| 3279 | + 'image_effects!' => 'none', | |
| 3280 | + 'image_effects' => 'slide' | |
| 3281 | + ] | |
| 3282 | + ] | |
| 3283 | + ); | |
| 3284 | + | |
| 3285 | + $this->end_controls_section(); | |
| 3286 | + | |
| 3287 | + // TODO: Check for issues. | |
| 3288 | +// $this->add_section_general_lightbox(); | |
| 3289 | + | |
| 3290 | + $this->start_controls_section( | |
| 3291 | + 'section_grid_filters', | |
| 3292 | + [ | |
| 3293 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Filters', 'king-addons'), | |
| 3294 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 3295 | + 'condition' => [ | |
| 3296 | + 'layout_select!' => 'slider', | |
| 3297 | + 'layout_filters' => 'yes', | |
| 3298 | + ], | |
| 3299 | + ] | |
| 3300 | + ); | |
| 3301 | + | |
| 3302 | + $this->add_control( | |
| 3303 | + 'filters_select', | |
| 3304 | + [ | |
| 3305 | + 'label' => esc_html__('Select Taxonomy', 'king-addons'), | |
| 3306 | + 'type' => Controls_Manager::SELECT, | |
| 3307 | + 'options' => $post_taxonomies, | |
| 3308 | + 'default' => 'category', | |
| 3309 | + ] | |
| 3310 | + ); | |
| 3311 | + | |
| 3312 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 3313 | + $this->add_control( | |
| 3314 | + 'filters_select_pro_notice', | |
| 3315 | + [ | |
| 3316 | + '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>', | |
| 3317 | + 'type' => Controls_Manager::RAW_HTML, | |
| 3318 | + 'content_classes' => 'king-addons-pro-notice', | |
| 3319 | + 'condition' => [ | |
| 3320 | + 'filters_select!' => ['category', 'post_tag'], | |
| 3321 | + ] | |
| 3322 | + ] | |
| 3323 | + ); | |
| 3324 | + } | |
| 3325 | + | |
| 3326 | + $this->add_control( | |
| 3327 | + 'filters_linkable', | |
| 3328 | + [ | |
| 3329 | + 'label' => esc_html__('Set Linkable Filters', 'king-addons'), | |
| 3330 | + 'type' => Controls_Manager::SWITCHER, | |
| 3331 | + 'default' => 'no', | |
| 3332 | + 'return_value' => 'yes', | |
| 3333 | + ] | |
| 3334 | + ); | |
| 3335 | + | |
| 3336 | + $this->add_control( | |
| 3337 | + 'filters_hide_empty', | |
| 3338 | + [ | |
| 3339 | + 'label' => esc_html__('Hide Empty Filters', 'king-addons'), | |
| 3340 | + 'type' => Controls_Manager::SWITCHER, | |
| 3341 | + 'default' => 'no', | |
| 3342 | + 'return_value' => 'yes', | |
| 3343 | + 'condition' => [ | |
| 3344 | + 'filters_linkable!' => 'yes', | |
| 3345 | + ], | |
| 3346 | + ] | |
| 3347 | + ); | |
| 3348 | + | |
| 3349 | + $this->add_control_filters_deeplinking(); | |
| 3350 | + | |
| 3351 | + $this->add_control( | |
| 3352 | + 'filters_all', | |
| 3353 | + [ | |
| 3354 | + 'label' => esc_html__('Show "All" Filter', 'king-addons'), | |
| 3355 | + 'type' => Controls_Manager::SWITCHER, | |
| 3356 | + 'default' => 'yes', | |
| 3357 | + 'return_value' => 'yes', | |
| 3358 | + 'condition' => [ | |
| 3359 | + 'filters_linkable!' => 'yes', | |
| 3360 | + ], | |
| 3361 | + ] | |
| 3362 | + ); | |
| 3363 | + | |
| 3364 | + $this->add_control( | |
| 3365 | + 'filters_all_text', | |
| 3366 | + [ | |
| 3367 | + 'label' => esc_html__('"All" Filter Text', 'king-addons'), | |
| 3368 | + 'type' => Controls_Manager::TEXT, | |
| 3369 | + 'dynamic' => [ | |
| 3370 | + 'active' => true, | |
| 3371 | + ], | |
| 3372 | + 'default' => 'All Posts', | |
| 3373 | + 'condition' => [ | |
| 3374 | + 'filters_all' => 'yes', | |
| 3375 | + 'filters_linkable!' => 'yes', | |
| 3376 | + ], | |
| 3377 | + ] | |
| 3378 | + ); | |
| 3379 | + | |
| 3380 | + $this->add_control_filters_count(); | |
| 3381 | + | |
| 3382 | + $this->add_control_filters_count_superscript(); | |
| 3383 | + | |
| 3384 | + $this->add_control_filters_count_brackets(); | |
| 3385 | + | |
| 3386 | + $this->add_control_filters_default_filter(); | |
| 3387 | + | |
| 3388 | + $this->add_control_filters_icon(); | |
| 3389 | + | |
| 3390 | + $this->add_control_filters_icon_align(); | |
| 3391 | + | |
| 3392 | + $this->add_control( | |
| 3393 | + 'filters_separator', | |
| 3394 | + [ | |
| 3395 | + 'label' => esc_html__('Separator', 'king-addons'), | |
| 3396 | + 'type' => Controls_Manager::TEXT, | |
| 3397 | + 'dynamic' => [ | |
| 3398 | + 'active' => true, | |
| 3399 | + ], | |
| 3400 | + 'default' => '', | |
| 3401 | + 'separator' => 'before', | |
| 3402 | + ] | |
| 3403 | + ); | |
| 3404 | + | |
| 3405 | + $this->add_control( | |
| 3406 | + 'filters_separator_align', | |
| 3407 | + [ | |
| 3408 | + 'label' => esc_html__('Separator Position', 'king-addons'), | |
| 3409 | + 'type' => Controls_Manager::CHOOSE, | |
| 3410 | + 'label_block' => false, | |
| 3411 | + 'default' => 'right', | |
| 3412 | + 'options' => [ | |
| 3413 | + 'left' => [ | |
| 3414 | + 'title' => esc_html__('Left', 'king-addons'), | |
| 3415 | + 'icon' => 'eicon-h-align-left', | |
| 3416 | + ], | |
| 3417 | + 'right' => [ | |
| 3418 | + 'title' => esc_html__('Right', 'king-addons'), | |
| 3419 | + 'icon' => 'eicon-h-align-right', | |
| 3420 | + ] | |
| 3421 | + ], | |
| 3422 | + 'condition' => [ | |
| 3423 | + 'filters_separator!' => '', | |
| 3424 | + ], | |
| 3425 | + ] | |
| 3426 | + ); | |
| 3427 | + | |
| 3428 | + $this->add_responsive_control( | |
| 3429 | + 'filters_align', | |
| 3430 | + [ | |
| 3431 | + 'label' => esc_html__('Align', 'king-addons'), | |
| 3432 | + 'type' => Controls_Manager::CHOOSE, | |
| 3433 | + 'label_block' => false, | |
| 3434 | + 'default' => 'center', | |
| 3435 | + 'options' => [ | |
| 3436 | + 'left' => [ | |
| 3437 | + 'title' => esc_html__('Left', 'king-addons'), | |
| 3438 | + 'icon' => 'eicon-h-align-left', | |
| 3439 | + ], | |
| 3440 | + 'center' => [ | |
| 3441 | + 'title' => esc_html__('Center', 'king-addons'), | |
| 3442 | + 'icon' => 'eicon-h-align-center', | |
| 3443 | + ], | |
| 3444 | + 'right' => [ | |
| 3445 | + 'title' => esc_html__('Right', 'king-addons'), | |
| 3446 | + 'icon' => 'eicon-h-align-right', | |
| 3447 | + ] | |
| 3448 | + ], | |
| 3449 | + 'selectors' => [ | |
| 3450 | + '{{WRAPPER}} .king-addons-grid-filters' => 'text-align: {{VALUE}}', | |
| 3451 | + ], | |
| 3452 | + 'separator' => 'before', | |
| 3453 | + ] | |
| 3454 | + ); | |
| 3455 | + | |
| 3456 | + $this->add_control_filters_animation(); | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'filters_animation', ['pro-fd', 'pro-fs']); | |
| 3460 | + | |
| 3461 | + $this->add_control( | |
| 3462 | + 'filters_animation_duration', | |
| 3463 | + [ | |
| 3464 | + 'label' => esc_html__('Animation Duration', 'king-addons'), | |
| 3465 | + 'type' => Controls_Manager::NUMBER, | |
| 3466 | + 'default' => 0.3, | |
| 3467 | + 'min' => 0, | |
| 3468 | + 'max' => 5, | |
| 3469 | + 'step' => 0.1, | |
| 3470 | + 'condition' => [ | |
| 3471 | + 'filters_animation!' => 'default', | |
| 3472 | + ], | |
| 3473 | + ] | |
| 3474 | + ); | |
| 3475 | + | |
| 3476 | + $this->add_control( | |
| 3477 | + 'filters_animation_delay', | |
| 3478 | + [ | |
| 3479 | + 'label' => esc_html__('Animation Delay', 'king-addons'), | |
| 3480 | + 'type' => Controls_Manager::NUMBER, | |
| 3481 | + 'default' => 0.1, | |
| 3482 | + 'min' => 0, | |
| 3483 | + 'max' => 5, | |
| 3484 | + 'step' => 0.05, | |
| 3485 | + 'condition' => [ | |
| 3486 | + 'filters_animation!' => 'default' | |
| 3487 | + ], | |
| 3488 | + ] | |
| 3489 | + ); | |
| 3490 | + | |
| 3491 | + $this->end_controls_section(); | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + $this->start_controls_section( | |
| 3495 | + 'section_grid_pagination', | |
| 3496 | + [ | |
| 3497 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Pagination', 'king-addons'), | |
| 3498 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 3499 | + 'condition' => [ | |
| 3500 | + 'layout_select!' => 'slider', | |
| 3501 | + 'layout_pagination' => 'yes', | |
| 3502 | + ], | |
| 3503 | + ] | |
| 3504 | + ); | |
| 3505 | + | |
| 3506 | + $this->add_control_pagination_type(); | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'grid', 'pagination_type', ['pro-is', 'pro-nb']); | |
| 3510 | + | |
| 3511 | + $this->add_control( | |
| 3512 | + 'pagination_older_text', | |
| 3513 | + [ | |
| 3514 | + 'label' => esc_html__('Older Posts Text', 'king-addons'), | |
| 3515 | + 'type' => Controls_Manager::TEXT, | |
| 3516 | + 'dynamic' => [ | |
| 3517 | + 'active' => true, | |
| 3518 | + ], | |
| 3519 | + 'default' => 'Older Posts', | |
| 3520 | + 'condition' => [ | |
| 3521 | + 'pagination_type' => 'default', | |
| 3522 | + ], | |
| 3523 | + ] | |
| 3524 | + ); | |
| 3525 | + | |
| 3526 | + $this->add_control( | |
| 3527 | + 'pagination_newer_text', | |
| 3528 | + [ | |
| 3529 | + 'label' => esc_html__('Newer Posts Text', 'king-addons'), | |
| 3530 | + 'type' => Controls_Manager::TEXT, | |
| 3531 | + 'dynamic' => [ | |
| 3532 | + 'active' => true, | |
| 3533 | + ], | |
| 3534 | + 'default' => 'Newer Posts', | |
| 3535 | + 'condition' => [ | |
| 3536 | + 'pagination_type' => 'default', | |
| 3537 | + ] | |
| 3538 | + ] | |
| 3539 | + ); | |
| 3540 | + | |
| 3541 | + $this->add_control( | |
| 3542 | + 'pagination_on_icon', | |
| 3543 | + [ | |
| 3544 | + 'label' => esc_html__('Select Icon', 'king-addons'), | |
| 3545 | + 'type' => Controls_Manager::SELECT, | |
| 3546 | + 'default' => 'fas fa-angle', | |
| 3547 | + 'options' => [ | |
| 3548 | + 'fas fa-angle' => esc_html__('Angle', 'king-addons'), | |
| 3549 | + 'fas fa-angle-double' => esc_html__('Angle Double', 'king-addons'), | |
| 3550 | + 'fas fa-arrow' => esc_html__('Arrow', 'king-addons'), | |
| 3551 | + 'fas fa-arrow-alt-circle' => esc_html__('Arrow Circle', 'king-addons'), | |
| 3552 | + 'far fa-arrow-alt-circle' => esc_html__('Arrow Circle Alt', 'king-addons'), | |
| 3553 | + 'fas fa-long-arrow-alt' => esc_html__('Long Arrow', 'king-addons'), | |
| 3554 | + 'fas fa-chevron' => esc_html__('Chevron', 'king-addons'), | |
| 3555 | + ], | |
| 3556 | + 'condition' => [ | |
| 3557 | + 'pagination_type' => 'default' | |
| 3558 | + ], | |
| 3559 | + ] | |
| 3560 | + ); | |
| 3561 | + | |
| 3562 | + $this->add_control( | |
| 3563 | + 'pagination_prev_next', | |
| 3564 | + [ | |
| 3565 | + 'label' => esc_html__('Previous & Next Buttons', 'king-addons'), | |
| 3566 | + 'type' => Controls_Manager::SWITCHER, | |
| 3567 | + 'default' => 'yes', | |
| 3568 | + 'return_value' => 'yes', | |
| 3569 | + 'condition' => [ | |
| 3570 | + 'pagination_type' => 'numbered', | |
| 3571 | + ], | |
| 3572 | + ] | |
| 3573 | + ); | |
| 3574 | + | |
| 3575 | + $this->add_control( | |
| 3576 | + 'pagination_prev_text', | |
| 3577 | + [ | |
| 3578 | + 'label' => esc_html__('Prev Page Text', 'king-addons'), | |
| 3579 | + 'type' => Controls_Manager::TEXT, | |
| 3580 | + 'dynamic' => [ | |
| 3581 | + 'active' => true, | |
| 3582 | + ], | |
| 3583 | + 'default' => 'Previous Page', | |
| 3584 | + 'condition' => [ | |
| 3585 | + 'pagination_type' => 'numbered', | |
| 3586 | + 'pagination_prev_next' => 'yes', | |
| 3587 | + ], | |
| 3588 | + ] | |
| 3589 | + ); | |
| 3590 | + | |
| 3591 | + $this->add_control( | |
| 3592 | + 'pagination_next_text', | |
| 3593 | + [ | |
| 3594 | + 'label' => esc_html__('Next Page Text', 'king-addons'), | |
| 3595 | + 'type' => Controls_Manager::TEXT, | |
| 3596 | + 'dynamic' => [ | |
| 3597 | + 'active' => true, | |
| 3598 | + ], | |
| 3599 | + 'default' => 'Next Page', | |
| 3600 | + 'condition' => [ | |
| 3601 | + 'pagination_type' => 'numbered', | |
| 3602 | + 'pagination_prev_next' => 'yes', | |
| 3603 | + ] | |
| 3604 | + ] | |
| 3605 | + ); | |
| 3606 | + | |
| 3607 | + $this->add_control( | |
| 3608 | + 'pagination_pn_icon', | |
| 3609 | + [ | |
| 3610 | + 'label' => esc_html__('Select Icon', 'king-addons'), | |
| 3611 | + 'type' => Controls_Manager::SELECT, | |
| 3612 | + 'default' => 'fas fa-angle', | |
| 3613 | + 'options' => [ | |
| 3614 | + 'fas fa-angle' => esc_html__('Angle', 'king-addons'), | |
| 3615 | + 'fas fa-angle-double' => esc_html__('Angle Double', 'king-addons'), | |
| 3616 | + 'fas fa-arrow' => esc_html__('Arrow', 'king-addons'), | |
| 3617 | + 'fas fa-arrow-alt-circle' => esc_html__('Arrow Circle', 'king-addons'), | |
| 3618 | + 'far fa-arrow-alt-circle' => esc_html__('Arrow Circle Alt', 'king-addons'), | |
| 3619 | + 'fas fa-long-arrow-alt' => esc_html__('Long Arrow', 'king-addons'), | |
| 3620 | + 'fas fa-chevron' => esc_html__('Chevron', 'king-addons'), | |
| 3621 | + ], | |
| 3622 | + 'condition' => [ | |
| 3623 | + 'pagination_type' => 'numbered', | |
| 3624 | + 'pagination_prev_next' => 'yes' | |
| 3625 | + ], | |
| 3626 | + ] | |
| 3627 | + ); | |
| 3628 | + | |
| 3629 | + $this->add_control( | |
| 3630 | + 'pagination_first_last', | |
| 3631 | + [ | |
| 3632 | + 'label' => esc_html__('First & Last Buttons', 'king-addons'), | |
| 3633 | + 'type' => Controls_Manager::SWITCHER, | |
| 3634 | + 'default' => 'yes', | |
| 3635 | + 'return_value' => 'yes', | |
| 3636 | + 'condition' => [ | |
| 3637 | + 'pagination_type' => 'numbered', | |
| 3638 | + ], | |
| 3639 | + ] | |
| 3640 | + ); | |
| 3641 | + | |
| 3642 | + $this->add_control( | |
| 3643 | + 'pagination_first_text', | |
| 3644 | + [ | |
| 3645 | + 'label' => esc_html__('First Page Text', 'king-addons'), | |
| 3646 | + 'type' => Controls_Manager::TEXT, | |
| 3647 | + 'dynamic' => [ | |
| 3648 | + 'active' => true, | |
| 3649 | + ], | |
| 3650 | + 'default' => 'First Page', | |
| 3651 | + 'condition' => [ | |
| 3652 | + 'pagination_type' => 'numbered', | |
| 3653 | + 'pagination_first_last' => 'yes', | |
| 3654 | + ], | |
| 3655 | + ] | |
| 3656 | + ); | |
| 3657 | + | |
| 3658 | + $this->add_control( | |
| 3659 | + 'pagination_last_text', | |
| 3660 | + [ | |
| 3661 | + 'label' => esc_html__('Last Page Text', 'king-addons'), | |
| 3662 | + 'type' => Controls_Manager::TEXT, | |
| 3663 | + 'dynamic' => [ | |
| 3664 | + 'active' => true, | |
| 3665 | + ], | |
| 3666 | + 'default' => 'Last Page', | |
| 3667 | + 'condition' => [ | |
| 3668 | + 'pagination_type' => 'numbered', | |
| 3669 | + 'pagination_first_last' => 'yes', | |
| 3670 | + ] | |
| 3671 | + ] | |
| 3672 | + ); | |
| 3673 | + | |
| 3674 | + $this->add_control( | |
| 3675 | + 'pagination_fl_icon', | |
| 3676 | + [ | |
| 3677 | + 'label' => esc_html__('Select Icon', 'king-addons'), | |
| 3678 | + 'type' => Controls_Manager::SELECT, | |
| 3679 | + 'default' => 'fas fa-angle-double', | |
| 3680 | + 'options' => [ | |
| 3681 | + 'fas fa-angle' => esc_html__('Angle', 'king-addons'), | |
| 3682 | + 'fas fa-angle-double' => esc_html__('Angle Double', 'king-addons'), | |
| 3683 | + 'fas fa-arrow' => esc_html__('Arrow', 'king-addons'), | |
| 3684 | + 'fas fa-arrow-alt-circle' => esc_html__('Arrow Circle', 'king-addons'), | |
| 3685 | + 'far fa-arrow-alt-circle' => esc_html__('Arrow Circle Alt', 'king-addons'), | |
| 3686 | + 'fas fa-long-arrow-alt' => esc_html__('Long Arrow', 'king-addons'), | |
| 3687 | + 'fas fa-chevron' => esc_html__('Chevron', 'king-addons'), | |
| 3688 | + ], | |
| 3689 | + 'condition' => [ | |
| 3690 | + 'pagination_type' => 'numbered', | |
| 3691 | + 'pagination_first_last' => 'yes' | |
| 3692 | + ], | |
| 3693 | + ] | |
| 3694 | + ); | |
| 3695 | + | |
| 3696 | + $this->add_control( | |
| 3697 | + 'pagination_disabled_arrows', | |
| 3698 | + [ | |
| 3699 | + 'label' => esc_html__('Show Disabled Buttons', 'king-addons'), | |
| 3700 | + 'type' => Controls_Manager::SWITCHER, | |
| 3701 | + 'default' => 'yes', | |
| 3702 | + 'return_value' => 'yes', | |
| 3703 | + 'condition' => [ | |
| 3704 | + 'pagination_type' => ['default', 'numbered'], | |
| 3705 | + ], | |
| 3706 | + ] | |
| 3707 | + ); | |
| 3708 | + | |
| 3709 | + $this->add_control( | |
| 3710 | + 'pagination_range', | |
| 3711 | + [ | |
| 3712 | + 'label' => esc_html__('Range', 'king-addons'), | |
| 3713 | + 'type' => Controls_Manager::NUMBER, | |
| 3714 | + 'default' => 2, | |
| 3715 | + 'min' => 1, | |
| 3716 | + 'condition' => [ | |
| 3717 | + 'pagination_type' => 'numbered', | |
| 3718 | + ] | |
| 3719 | + ] | |
| 3720 | + ); | |
| 3721 | + | |
| 3722 | + $this->add_control( | |
| 3723 | + 'pagination_load_more_text', | |
| 3724 | + [ | |
| 3725 | + 'label' => esc_html__('Load More Text', 'king-addons'), | |
| 3726 | + 'type' => Controls_Manager::TEXT, | |
| 3727 | + 'dynamic' => [ | |
| 3728 | + 'active' => true, | |
| 3729 | + ], | |
| 3730 | + 'default' => 'Load More', | |
| 3731 | + 'condition' => [ | |
| 3732 | + 'pagination_type' => 'load-more', | |
| 3733 | + ] | |
| 3734 | + ] | |
| 3735 | + ); | |
| 3736 | + | |
| 3737 | + $this->add_control( | |
| 3738 | + 'pagination_finish_text', | |
| 3739 | + [ | |
| 3740 | + 'label' => esc_html__('Finish Text', 'king-addons'), | |
| 3741 | + 'type' => Controls_Manager::TEXT, | |
| 3742 | + 'dynamic' => [ | |
| 3743 | + 'active' => true, | |
| 3744 | + ], | |
| 3745 | + 'default' => 'End of Content.', | |
| 3746 | + 'condition' => [ | |
| 3747 | + 'pagination_type' => ['load-more', 'infinite-scroll'], | |
| 3748 | + ] | |
| 3749 | + ] | |
| 3750 | + ); | |
| 3751 | + | |
| 3752 | + $this->add_control( | |
| 3753 | + 'pagination_animation', | |
| 3754 | + [ | |
| 3755 | + 'label' => esc_html__('Select Animation', 'king-addons'), | |
| 3756 | + 'type' => Controls_Manager::SELECT, | |
| 3757 | + 'default' => 'loader-1', | |
| 3758 | + 'options' => [ | |
| 3759 | + 'none' => esc_html__('None', 'king-addons'), | |
| 3760 | + 'loader-1' => esc_html__('Loader 1', 'king-addons'), | |
| 3761 | + 'loader-2' => esc_html__('Loader 2', 'king-addons'), | |
| 3762 | + 'loader-3' => esc_html__('Loader 3', 'king-addons'), | |
| 3763 | + 'loader-4' => esc_html__('Loader 4', 'king-addons'), | |
| 3764 | + 'loader-5' => esc_html__('Loader 5', 'king-addons'), | |
| 3765 | + 'loader-6' => esc_html__('Loader 6', 'king-addons'), | |
| 3766 | + ], | |
| 3767 | + 'condition' => [ | |
| 3768 | + 'pagination_type' => ['load-more', 'infinite-scroll'], | |
| 3769 | + ] | |
| 3770 | + ] | |
| 3771 | + ); | |
| 3772 | + | |
| 3773 | + $this->add_control( | |
| 3774 | + 'pagination_align', | |
| 3775 | + [ | |
| 3776 | + 'label' => esc_html__('Alignment', 'king-addons'), | |
| 3777 | + 'type' => Controls_Manager::CHOOSE, | |
| 3778 | + 'options' => [ | |
| 3779 | + 'left' => [ | |
| 3780 | + 'title' => esc_html__('Left', 'king-addons'), | |
| 3781 | + 'icon' => 'eicon-text-align-left', | |
| 3782 | + ], | |
| 3783 | + 'center' => [ | |
| 3784 | + 'title' => esc_html__('Center', 'king-addons'), | |
| 3785 | + 'icon' => 'eicon-text-align-center', | |
| 3786 | + ], | |
| 3787 | + 'right' => [ | |
| 3788 | + 'title' => esc_html__('Right', 'king-addons'), | |
| 3789 | + 'icon' => 'eicon-text-align-right', | |
| 3790 | + ], | |
| 3791 | + 'justify' => [ | |
| 3792 | + 'title' => esc_html__('Justified', 'king-addons'), | |
| 3793 | + 'icon' => 'eicon-text-align-justify', | |
| 3794 | + ], | |
| 3795 | + ], | |
| 3796 | + 'default' => 'center', | |
| 3797 | + 'prefix_class' => 'king-addons-grid-pagination-', | |
| 3798 | + 'render_type' => 'template', | |
| 3799 | + 'separator' => 'before', | |
| 3800 | + 'condition' => [ | |
| 3801 | + 'pagination_type!' => 'infinite-scroll', | |
| 3802 | + ] | |
| 3803 | + ] | |
| 3804 | + ); | |
| 3805 | + | |
| 3806 | + $this->end_controls_section(); | |
| 3807 | + | |
| 3808 | + Core::renderProFeaturesSection($this, '', Controls_Manager::RAW_HTML, 'grid', [ | |
| 3809 | + 'Grid Columns 1, 2, 3, 4, 5, 6', | |
| 3810 | + 'Masonry Layout', | |
| 3811 | + 'Posts Slider Columns (Carousel) 1, 2, 3, 4, 5, 6', | |
| 3812 | + 'Post Slider Autoplay Options', | |
| 3813 | + 'Infinite Scrolling Pagination', | |
| 3814 | + 'Related Posts Query, Current Page Query, Random Posts Query', | |
| 3815 | + 'Custom Post Types Support', | |
| 3816 | + 'Custom Fields Support', | |
| 3817 | + 'Trim Title & Excerpt By Letter Count', | |
| 3818 | + 'Posts Order', | |
| 3819 | + 'Display Scheduled Posts', | |
| 3820 | + 'Post Slider Advanced Navigation Positioning', | |
| 3821 | + 'Post Slider Advanced Pagination Positioning', | |
| 3822 | + 'Grid Category Filter Deep Linking', | |
| 3823 | + 'Grid Category Filter Icons Select', | |
| 3824 | + 'Grid Category Filter Count', | |
| 3825 | + 'Grid Item Even/Odd Background Color', | |
| 3826 | + 'Lightbox Thumbnail Gallery, Lightbox Image Sharing Button', | |
| 3827 | + 'Open Links in New Tab', | |
| 3828 | + 'Lazy Loading', | |
| 3829 | + 'Advanced Grid Loading Animations (Fade In & Slide Up)', | |
| 3830 | + 'Advanced Grid Elements Positioning', | |
| 3831 | + 'Title, Category, Read More Advanced Link Hover Animations', | |
| 3832 | + 'Advanced Post Likes', | |
| 3833 | + 'Advanced Post Sharing', | |
| 3834 | + 'Unlimited Image Overlay Animations', | |
| 3835 | + 'Image Overlay GIF Upload Option', | |
| 3836 | + 'Image Overlay Blend Mode', | |
| 3837 | + 'Image Effects: Zoom, Grayscale, Blur', | |
| 3838 | + 'List Layout Zig-zag', | |
| 3839 | + 'Secondary Featured Image' | |
| 3840 | + ]); | |
| 3841 | + | |
| 3842 | + $this->start_controls_section( | |
| 3843 | + 'section_style_grid_item', | |
| 3844 | + [ | |
| 3845 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Grid Item', 'king-addons'), | |
| 3846 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 3847 | + 'show_label' => false, | |
| 3848 | + ] | |
| 3849 | + ); | |
| 3850 | + | |
| 3851 | + $this->add_control( | |
| 3852 | + 'grid_item_styles_selector', | |
| 3853 | + [ | |
| 3854 | + 'label' => esc_html__('Apply Styles To', 'king-addons'), | |
| 3855 | + 'type' => Controls_Manager::SELECT, | |
| 3856 | + 'options' => [ | |
| 3857 | + 'inner' => esc_html__('Inner Elements', 'king-addons'), | |
| 3858 | + 'wrapper' => esc_html__('Wrapper', 'king-addons') | |
| 3859 | + ], | |
| 3860 | + 'default' => 'inner', | |
| 3861 | + 'prefix_class' => 'king-addons-item-styles-', | |
| 3862 | + 'render_type' => 'template' | |
| 3863 | + ] | |
| 3864 | + ); | |
| 3865 | + | |
| 3866 | + $this->add_control( | |
| 3867 | + 'grid_item_bg_color', | |
| 3868 | + [ | |
| 3869 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 3870 | + 'type' => Controls_Manager::COLOR, | |
| 3871 | + 'default' => '', | |
| 3872 | + 'selectors' => [ | |
| 3873 | + '{{WRAPPER}} .king-addons-grid-item-above-content' => 'background-color: {{VALUE}}', | |
| 3874 | + '{{WRAPPER}} .king-addons-grid-item-below-content' => 'background-color: {{VALUE}}', | |
| 3875 | + '{{WRAPPER}} .king-addons-grid[data-settings*="fitRows"] .king-addons-grid-item' => 'background-color: {{VALUE}}', | |
| 3876 | + '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'background-color: {{VALUE}}' | |
| 3877 | + ], | |
| 3878 | + ] | |
| 3879 | + ); | |
| 3880 | + | |
| 3881 | + $this->add_control_grid_item_even_bg_color(); | |
| 3882 | + | |
| 3883 | + $this->add_control( | |
| 3884 | + 'grid_item_border_color', | |
| 3885 | + [ | |
| 3886 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 3887 | + 'type' => Controls_Manager::COLOR, | |
| 3888 | + 'default' => '#E8E8E8', | |
| 3889 | + 'selectors' => [ | |
| 3890 | + '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-above-content' => 'border-color: {{VALUE}}', | |
| 3891 | + '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-below-content' => 'border-color: {{VALUE}}', | |
| 3892 | + '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'border-color: {{VALUE}}' | |
| 3893 | + ], | |
| 3894 | + ] | |
| 3895 | + ); | |
| 3896 | + | |
| 3897 | + $this->add_control_grid_item_even_border_color(); | |
| 3898 | + | |
| 3899 | + $this->add_control( | |
| 3900 | + 'grid_item_border_type', | |
| 3901 | + [ | |
| 3902 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 3903 | + 'type' => Controls_Manager::SELECT, | |
| 3904 | + 'options' => [ | |
| 3905 | + 'none' => esc_html__('None', 'king-addons'), | |
| 3906 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 3907 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 3908 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 3909 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 3910 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 3911 | + ], | |
| 3912 | + 'default' => 'none', | |
| 3913 | + 'selectors' => [ | |
| 3914 | + '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-above-content' => 'border-style: {{VALUE}};', | |
| 3915 | + '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-below-content' => 'border-style: {{VALUE}};', | |
| 3916 | + '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'border-style: {{VALUE}}' | |
| 3917 | + ], | |
| 3918 | + 'separator' => 'before', | |
| 3919 | + ] | |
| 3920 | + ); | |
| 3921 | + | |
| 3922 | + $this->add_control( | |
| 3923 | + 'grid_item_border_width', | |
| 3924 | + [ | |
| 3925 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 3926 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3927 | + 'size_units' => ['px'], | |
| 3928 | + 'default' => [ | |
| 3929 | + 'top' => 1, | |
| 3930 | + 'right' => 1, | |
| 3931 | + 'bottom' => 1, | |
| 3932 | + 'left' => 1, | |
| 3933 | + ], | |
| 3934 | + 'selectors' => [ | |
| 3935 | + '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-above-content' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3936 | + '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-below-content' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3937 | + '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' | |
| 3938 | + ], | |
| 3939 | + 'condition' => [ | |
| 3940 | + 'grid_item_border_type!' => 'none', | |
| 3941 | + ], | |
| 3942 | + 'render_type' => 'template' | |
| 3943 | + ] | |
| 3944 | + ); | |
| 3945 | + | |
| 3946 | + $this->add_responsive_control( | |
| 3947 | + 'grid_item_padding', | |
| 3948 | + [ | |
| 3949 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 3950 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3951 | + 'size_units' => ['px'], | |
| 3952 | + 'default' => [ | |
| 3953 | + 'top' => 10, | |
| 3954 | + 'right' => 0, | |
| 3955 | + 'bottom' => 0, | |
| 3956 | + 'left' => 0, | |
| 3957 | + ], | |
| 3958 | + 'selectors' => [ | |
| 3959 | + '{{WRAPPER}} .king-addons-grid-item-above-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3960 | + '{{WRAPPER}} .king-addons-grid-item-below-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 3961 | + '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' | |
| 3962 | + ], | |
| 3963 | + 'condition' => [ | |
| 3964 | + 'grid_item_styles_selector' => 'inner' | |
| 3965 | + ], | |
| 3966 | + 'render_type' => 'template' | |
| 3967 | + ] | |
| 3968 | + ); | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + $this->add_responsive_control( | |
| 3972 | + 'grid_item_wrap_padding', | |
| 3973 | + [ | |
| 3974 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 3975 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3976 | + 'size_units' => ['px'], | |
| 3977 | + 'default' => [ | |
| 3978 | + 'top' => 10, | |
| 3979 | + 'right' => 0, | |
| 3980 | + 'bottom' => 0, | |
| 3981 | + 'left' => 0, | |
| 3982 | + ], | |
| 3983 | + 'selectors' => [ | |
| 3984 | + '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' | |
| 3985 | + ], | |
| 3986 | + 'condition' => [ | |
| 3987 | + 'grid_item_styles_selector' => 'wrapper' | |
| 3988 | + ], | |
| 3989 | + 'render_type' => 'template' | |
| 3990 | + ] | |
| 3991 | + ); | |
| 3992 | + | |
| 3993 | + $this->add_control( | |
| 3994 | + 'grid_item_radius', | |
| 3995 | + [ | |
| 3996 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 3997 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 3998 | + 'size_units' => ['px', '%'], | |
| 3999 | + 'default' => [ | |
| 4000 | + 'top' => 0, | |
| 4001 | + 'right' => 0, | |
| 4002 | + 'bottom' => 0, | |
| 4003 | + 'left' => 0, | |
| 4004 | + ], | |
| 4005 | + 'selectors' => [ | |
| 4006 | + '{{WRAPPER}} .king-addons-grid-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4007 | + '{{WRAPPER}} .king-addons-grid-item-above-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4008 | + '{{WRAPPER}} .king-addons-grid-item-below-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4009 | + ], | |
| 4010 | + 'separator' => 'before', | |
| 4011 | + ] | |
| 4012 | + ); | |
| 4013 | + | |
| 4014 | + $this->add_group_control( | |
| 4015 | + Group_Control_Box_Shadow::get_type(), | |
| 4016 | + [ | |
| 4017 | + 'name' => 'grid_item_shadow', | |
| 4018 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item', | |
| 4019 | + ] | |
| 4020 | + ); | |
| 4021 | + | |
| 4022 | + $this->end_controls_section(); | |
| 4023 | + | |
| 4024 | + | |
| 4025 | + $this->start_controls_section( | |
| 4026 | + 'section_style_grid_media', | |
| 4027 | + [ | |
| 4028 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Grid Media', 'king-addons'), | |
| 4029 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4030 | + 'show_label' => false, | |
| 4031 | + ] | |
| 4032 | + ); | |
| 4033 | + | |
| 4034 | + $this->add_control( | |
| 4035 | + 'grid_media_border_color', | |
| 4036 | + [ | |
| 4037 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4038 | + 'type' => Controls_Manager::COLOR, | |
| 4039 | + 'default' => '#E8E8E8', | |
| 4040 | + 'selectors' => [ | |
| 4041 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-color: {{VALUE}}', | |
| 4042 | + ] | |
| 4043 | + ] | |
| 4044 | + ); | |
| 4045 | + | |
| 4046 | + $this->add_control( | |
| 4047 | + 'grid_media_border_type', | |
| 4048 | + [ | |
| 4049 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 4050 | + 'type' => Controls_Manager::SELECT, | |
| 4051 | + 'options' => [ | |
| 4052 | + 'none' => esc_html__('None', 'king-addons'), | |
| 4053 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4054 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4055 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4056 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4057 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4058 | + ], | |
| 4059 | + 'default' => 'none', | |
| 4060 | + 'selectors' => [ | |
| 4061 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-style: {{VALUE}};', | |
| 4062 | + ] | |
| 4063 | + ] | |
| 4064 | + ); | |
| 4065 | + | |
| 4066 | + $this->add_control( | |
| 4067 | + 'grid_media_border_width', | |
| 4068 | + [ | |
| 4069 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 4070 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4071 | + 'size_units' => ['px'], | |
| 4072 | + 'default' => [ | |
| 4073 | + 'top' => 1, | |
| 4074 | + 'right' => 1, | |
| 4075 | + 'bottom' => 1, | |
| 4076 | + 'left' => 1, | |
| 4077 | + ], | |
| 4078 | + 'selectors' => [ | |
| 4079 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4080 | + ], | |
| 4081 | + 'condition' => [ | |
| 4082 | + 'grid_media_border_type!' => 'none', | |
| 4083 | + ], | |
| 4084 | + ] | |
| 4085 | + ); | |
| 4086 | + | |
| 4087 | + $this->add_control( | |
| 4088 | + 'grid_media_radius', | |
| 4089 | + [ | |
| 4090 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 4091 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4092 | + 'size_units' => ['px', '%'], | |
| 4093 | + 'default' => [ | |
| 4094 | + 'top' => 0, | |
| 4095 | + 'right' => 0, | |
| 4096 | + 'bottom' => 0, | |
| 4097 | + 'left' => 0, | |
| 4098 | + ], | |
| 4099 | + 'selectors' => [ | |
| 4100 | + '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4101 | + ], | |
| 4102 | + 'separator' => 'before', | |
| 4103 | + ] | |
| 4104 | + ); | |
| 4105 | + | |
| 4106 | + $this->end_controls_section(); | |
| 4107 | + | |
| 4108 | + | |
| 4109 | + $this->start_controls_section( | |
| 4110 | + 'section_style_overlay', | |
| 4111 | + [ | |
| 4112 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'), | |
| 4113 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4114 | + 'show_label' => false, | |
| 4115 | + ] | |
| 4116 | + ); | |
| 4117 | + | |
| 4118 | + $this->add_control_overlay_color(); | |
| 4119 | + | |
| 4120 | + $this->add_control_overlay_blend_mode(); | |
| 4121 | + | |
| 4122 | + $this->add_control_overlay_border_color(); | |
| 4123 | + | |
| 4124 | + $this->add_control_overlay_border_type(); | |
| 4125 | + | |
| 4126 | + $this->add_control_overlay_border_width(); | |
| 4127 | + | |
| 4128 | + $this->add_control( | |
| 4129 | + 'overlay_radius', | |
| 4130 | + [ | |
| 4131 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 4132 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4133 | + 'size_units' => ['px', '%'], | |
| 4134 | + 'default' => [ | |
| 4135 | + 'top' => 0, | |
| 4136 | + 'right' => 0, | |
| 4137 | + 'bottom' => 0, | |
| 4138 | + 'left' => 0, | |
| 4139 | + ], | |
| 4140 | + 'selectors' => [ | |
| 4141 | + '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4142 | + ], | |
| 4143 | + 'separator' => 'before', | |
| 4144 | + ] | |
| 4145 | + ); | |
| 4146 | + | |
| 4147 | + $this->end_controls_section(); | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + $this->start_controls_section( | |
| 4151 | + 'section_style_title', | |
| 4152 | + [ | |
| 4153 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Title', 'king-addons'), | |
| 4154 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4155 | + 'show_label' => false, | |
| 4156 | + ] | |
| 4157 | + ); | |
| 4158 | + | |
| 4159 | + $this->start_controls_tabs('tabs_grid_title_style'); | |
| 4160 | + | |
| 4161 | + $this->start_controls_tab( | |
| 4162 | + 'tab_grid_title_normal', | |
| 4163 | + [ | |
| 4164 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 4165 | + ] | |
| 4166 | + ); | |
| 4167 | + | |
| 4168 | + $this->add_control( | |
| 4169 | + 'title_color', | |
| 4170 | + [ | |
| 4171 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4172 | + 'type' => Controls_Manager::COLOR, | |
| 4173 | + 'default' => '#333333', | |
| 4174 | + 'selectors' => [ | |
| 4175 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'color: {{VALUE}}', | |
| 4176 | + ], | |
| 4177 | + ] | |
| 4178 | + ); | |
| 4179 | + | |
| 4180 | + $this->add_control( | |
| 4181 | + 'title_bg_color', | |
| 4182 | + [ | |
| 4183 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4184 | + 'type' => Controls_Manager::COLOR, | |
| 4185 | + 'selectors' => [ | |
| 4186 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'background-color: {{VALUE}}', | |
| 4187 | + ] | |
| 4188 | + ] | |
| 4189 | + ); | |
| 4190 | + | |
| 4191 | + $this->add_control( | |
| 4192 | + 'title_border_color', | |
| 4193 | + [ | |
| 4194 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4195 | + 'type' => Controls_Manager::COLOR, | |
| 4196 | + 'default' => '#E8E8E8', | |
| 4197 | + 'selectors' => [ | |
| 4198 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-color: {{VALUE}}', | |
| 4199 | + ], | |
| 4200 | + 'separator' => 'after', | |
| 4201 | + ] | |
| 4202 | + ); | |
| 4203 | + | |
| 4204 | + $this->end_controls_tab(); | |
| 4205 | + | |
| 4206 | + $this->start_controls_tab( | |
| 4207 | + 'tab_grid_title_hover', | |
| 4208 | + [ | |
| 4209 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 4210 | + ] | |
| 4211 | + ); | |
| 4212 | + | |
| 4213 | + $this->add_control( | |
| 4214 | + 'title_color_hr', | |
| 4215 | + [ | |
| 4216 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4217 | + 'type' => Controls_Manager::COLOR, | |
| 4218 | + 'default' => '#54595f', | |
| 4219 | + 'selectors' => [ | |
| 4220 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'color: {{VALUE}}', | |
| 4221 | + ], | |
| 4222 | + ] | |
| 4223 | + ); | |
| 4224 | + | |
| 4225 | + $this->add_control( | |
| 4226 | + 'title_bg_color_hr', | |
| 4227 | + [ | |
| 4228 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4229 | + 'type' => Controls_Manager::COLOR, | |
| 4230 | + 'selectors' => [ | |
| 4231 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 4232 | + ] | |
| 4233 | + ] | |
| 4234 | + ); | |
| 4235 | + | |
| 4236 | + $this->add_control( | |
| 4237 | + 'title_border_color_hr', | |
| 4238 | + [ | |
| 4239 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4240 | + 'type' => Controls_Manager::COLOR, | |
| 4241 | + 'default' => '#E8E8E8', | |
| 4242 | + 'selectors' => [ | |
| 4243 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 4244 | + ], | |
| 4245 | + ] | |
| 4246 | + ); | |
| 4247 | + | |
| 4248 | + $this->add_control_title_pointer_color_hr(); | |
| 4249 | + | |
| 4250 | + $this->end_controls_tab(); | |
| 4251 | + | |
| 4252 | + $this->end_controls_tabs(); | |
| 4253 | + | |
| 4254 | + $this->add_control_title_pointer(); | |
| 4255 | + | |
| 4256 | + $this->add_control_title_pointer_height(); | |
| 4257 | + | |
| 4258 | + $this->add_control_title_pointer_animation(); | |
| 4259 | + | |
| 4260 | + $this->add_control( | |
| 4261 | + 'title_transition_duration', | |
| 4262 | + [ | |
| 4263 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 4264 | + 'type' => Controls_Manager::NUMBER, | |
| 4265 | + 'default' => 0.2, | |
| 4266 | + 'min' => 0, | |
| 4267 | + 'max' => 5, | |
| 4268 | + 'step' => 0.1, | |
| 4269 | + 'selectors' => [ | |
| 4270 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 4271 | + '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s', | |
| 4272 | + '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s', | |
| 4273 | + ], | |
| 4274 | + 'separator' => 'after', | |
| 4275 | + ] | |
| 4276 | + ); | |
| 4277 | + | |
| 4278 | + $this->add_group_control( | |
| 4279 | + Group_Control_Typography::get_type(), | |
| 4280 | + [ | |
| 4281 | + 'name' => 'title_typography', | |
| 4282 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-title a' | |
| 4283 | + ] | |
| 4284 | + ); | |
| 4285 | + | |
| 4286 | + $this->add_control( | |
| 4287 | + 'title_border_type', | |
| 4288 | + [ | |
| 4289 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 4290 | + 'type' => Controls_Manager::SELECT, | |
| 4291 | + 'options' => [ | |
| 4292 | + 'none' => esc_html__('None', 'king-addons'), | |
| 4293 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4294 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4295 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4296 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4297 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4298 | + ], | |
| 4299 | + 'default' => 'none', | |
| 4300 | + 'selectors' => [ | |
| 4301 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-style: {{VALUE}};', | |
| 4302 | + ], | |
| 4303 | + 'render_type' => 'template', | |
| 4304 | + 'separator' => 'before', | |
| 4305 | + ] | |
| 4306 | + ); | |
| 4307 | + | |
| 4308 | + $this->add_control( | |
| 4309 | + 'title_border_width', | |
| 4310 | + [ | |
| 4311 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 4312 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4313 | + 'size_units' => ['px'], | |
| 4314 | + 'default' => [ | |
| 4315 | + 'top' => 1, | |
| 4316 | + 'right' => 1, | |
| 4317 | + 'bottom' => 1, | |
| 4318 | + 'left' => 1, | |
| 4319 | + ], | |
| 4320 | + 'selectors' => [ | |
| 4321 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4322 | + ], | |
| 4323 | + 'render_type' => 'template', | |
| 4324 | + 'condition' => [ | |
| 4325 | + 'title_border_type!' => 'none', | |
| 4326 | + ], | |
| 4327 | + ] | |
| 4328 | + ); | |
| 4329 | + | |
| 4330 | + $this->add_responsive_control( | |
| 4331 | + 'title_padding', | |
| 4332 | + [ | |
| 4333 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 4334 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4335 | + 'size_units' => ['px', '%'], | |
| 4336 | + 'default' => [ | |
| 4337 | + 'top' => 0, | |
| 4338 | + 'right' => 0, | |
| 4339 | + 'bottom' => 0, | |
| 4340 | + 'left' => 0, | |
| 4341 | + ], | |
| 4342 | + 'selectors' => [ | |
| 4343 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4344 | + ], | |
| 4345 | + 'render_type' => 'template', | |
| 4346 | + 'separator' => 'before', | |
| 4347 | + ] | |
| 4348 | + ); | |
| 4349 | + | |
| 4350 | + $this->add_responsive_control( | |
| 4351 | + 'title_margin', | |
| 4352 | + [ | |
| 4353 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4354 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4355 | + 'size_units' => ['px', '%'], | |
| 4356 | + 'default' => [ | |
| 4357 | + 'top' => 0, | |
| 4358 | + 'right' => 0, | |
| 4359 | + 'bottom' => 0, | |
| 4360 | + 'left' => 0, | |
| 4361 | + ], | |
| 4362 | + 'selectors' => [ | |
| 4363 | + '{{WRAPPER}} .king-addons-grid-item-title .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4364 | + ], | |
| 4365 | + 'render_type' => 'template', | |
| 4366 | + ] | |
| 4367 | + ); | |
| 4368 | + | |
| 4369 | + $this->end_controls_section(); | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + $this->start_controls_section( | |
| 4373 | + 'section_style_content', | |
| 4374 | + [ | |
| 4375 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Content', 'king-addons'), | |
| 4376 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4377 | + 'show_label' => false, | |
| 4378 | + ] | |
| 4379 | + ); | |
| 4380 | + | |
| 4381 | + $this->add_control( | |
| 4382 | + 'content_color', | |
| 4383 | + [ | |
| 4384 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4385 | + 'type' => Controls_Manager::COLOR, | |
| 4386 | + 'default' => '#6A6A6A', | |
| 4387 | + 'selectors' => [ | |
| 4388 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'color: {{VALUE}}', | |
| 4389 | + ], | |
| 4390 | + ] | |
| 4391 | + ); | |
| 4392 | + | |
| 4393 | + $this->add_control( | |
| 4394 | + 'content_dropcap_color', | |
| 4395 | + [ | |
| 4396 | + 'label' => esc_html__('DropCap Color', 'king-addons'), | |
| 4397 | + 'type' => Controls_Manager::COLOR, | |
| 4398 | + 'default' => '#3a3a3a', | |
| 4399 | + 'selectors' => [ | |
| 4400 | + '{{WRAPPER}} .king-addons-grid-item-content.king-addons-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}', | |
| 4401 | + ], | |
| 4402 | + ] | |
| 4403 | + ); | |
| 4404 | + | |
| 4405 | + $this->add_control( | |
| 4406 | + 'content_bg_color', | |
| 4407 | + [ | |
| 4408 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4409 | + 'type' => Controls_Manager::COLOR, | |
| 4410 | + 'selectors' => [ | |
| 4411 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'background-color: {{VALUE}}', | |
| 4412 | + ] | |
| 4413 | + ] | |
| 4414 | + ); | |
| 4415 | + | |
| 4416 | + $this->add_control( | |
| 4417 | + 'content_border_color', | |
| 4418 | + [ | |
| 4419 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4420 | + 'type' => Controls_Manager::COLOR, | |
| 4421 | + 'default' => '#E8E8E8', | |
| 4422 | + 'selectors' => [ | |
| 4423 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-color: {{VALUE}}', | |
| 4424 | + ], | |
| 4425 | + 'separator' => 'after', | |
| 4426 | + ] | |
| 4427 | + ); | |
| 4428 | + | |
| 4429 | + $this->add_group_control( | |
| 4430 | + Group_Control_Typography::get_type(), | |
| 4431 | + [ | |
| 4432 | + 'name' => 'content_typography', | |
| 4433 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-content' | |
| 4434 | + ] | |
| 4435 | + ); | |
| 4436 | + | |
| 4437 | + $this->add_group_control( | |
| 4438 | + Group_Control_Typography::get_type(), | |
| 4439 | + [ | |
| 4440 | + 'name' => 'content_dropcap_typography', | |
| 4441 | + 'label' => esc_html__('Drop Cap Typography', 'king-addons'), | |
| 4442 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-content.king-addons-enable-dropcap p:first-child:first-letter' | |
| 4443 | + ] | |
| 4444 | + ); | |
| 4445 | + | |
| 4446 | + $this->add_responsive_control( | |
| 4447 | + 'content_justify', | |
| 4448 | + [ | |
| 4449 | + 'label' => esc_html__('Justify Text', 'king-addons'), | |
| 4450 | + 'type' => Controls_Manager::SWITCHER, | |
| 4451 | + 'default' => '', | |
| 4452 | + 'widescreen_default' => '', | |
| 4453 | + 'laptop_default' => '', | |
| 4454 | + 'tablet_extra_default' => '', | |
| 4455 | + 'tablet_default' => '', | |
| 4456 | + 'mobile_extra_default' => '', | |
| 4457 | + 'mobile_default' => '', | |
| 4458 | + 'selectors_dictionary' => [ | |
| 4459 | + '' => '', | |
| 4460 | + 'yes' => 'text-align: justify;' | |
| 4461 | + ], | |
| 4462 | + 'selectors' => [ | |
| 4463 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => '{{VALUE}}', | |
| 4464 | + ], | |
| 4465 | + 'render_type' => 'template', | |
| 4466 | + ] | |
| 4467 | + ); | |
| 4468 | + | |
| 4469 | + $this->add_control( | |
| 4470 | + 'content_width', | |
| 4471 | + [ | |
| 4472 | + 'label' => esc_html__('Content Width', 'king-addons'), | |
| 4473 | + 'type' => Controls_Manager::SLIDER, | |
| 4474 | + 'size_units' => ['%'], | |
| 4475 | + 'range' => [ | |
| 4476 | + '%' => [ | |
| 4477 | + 'min' => 10, | |
| 4478 | + 'max' => 100, | |
| 4479 | + ], | |
| 4480 | + ], | |
| 4481 | + 'default' => [ | |
| 4482 | + 'unit' => '%', | |
| 4483 | + 'size' => 100, | |
| 4484 | + ], | |
| 4485 | + 'selectors' => [ | |
| 4486 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'width: {{SIZE}}{{UNIT}};', | |
| 4487 | + ], | |
| 4488 | + 'separator' => 'before', | |
| 4489 | + ] | |
| 4490 | + ); | |
| 4491 | + | |
| 4492 | + $this->add_control( | |
| 4493 | + 'content_border_type', | |
| 4494 | + [ | |
| 4495 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 4496 | + 'type' => Controls_Manager::SELECT, | |
| 4497 | + 'options' => [ | |
| 4498 | + 'none' => esc_html__('None', 'king-addons'), | |
| 4499 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4500 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4501 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4502 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4503 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4504 | + ], | |
| 4505 | + 'default' => 'none', | |
| 4506 | + 'selectors' => [ | |
| 4507 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-style: {{VALUE}};', | |
| 4508 | + ], | |
| 4509 | + 'render_type' => 'template', | |
| 4510 | + 'separator' => 'before', | |
| 4511 | + ] | |
| 4512 | + ); | |
| 4513 | + | |
| 4514 | + $this->add_control( | |
| 4515 | + 'content_border_width', | |
| 4516 | + [ | |
| 4517 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 4518 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4519 | + 'size_units' => ['px'], | |
| 4520 | + 'default' => [ | |
| 4521 | + 'top' => 1, | |
| 4522 | + 'right' => 1, | |
| 4523 | + 'bottom' => 1, | |
| 4524 | + 'left' => 1, | |
| 4525 | + ], | |
| 4526 | + 'selectors' => [ | |
| 4527 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4528 | + ], | |
| 4529 | + 'render_type' => 'template', | |
| 4530 | + 'condition' => [ | |
| 4531 | + 'content_border_type!' => 'none', | |
| 4532 | + ], | |
| 4533 | + ] | |
| 4534 | + ); | |
| 4535 | + | |
| 4536 | + $this->add_responsive_control( | |
| 4537 | + 'content_padding', | |
| 4538 | + [ | |
| 4539 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 4540 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4541 | + 'size_units' => ['px', '%'], | |
| 4542 | + 'default' => [ | |
| 4543 | + 'top' => 0, | |
| 4544 | + 'right' => 0, | |
| 4545 | + 'bottom' => 0, | |
| 4546 | + 'left' => 0, | |
| 4547 | + ], | |
| 4548 | + 'selectors' => [ | |
| 4549 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4550 | + ], | |
| 4551 | + 'render_type' => 'template', | |
| 4552 | + 'separator' => 'before', | |
| 4553 | + ] | |
| 4554 | + ); | |
| 4555 | + | |
| 4556 | + $this->add_responsive_control( | |
| 4557 | + 'content_margin', | |
| 4558 | + [ | |
| 4559 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4560 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4561 | + 'size_units' => ['px', '%'], | |
| 4562 | + 'default' => [ | |
| 4563 | + 'top' => 0, | |
| 4564 | + 'right' => 0, | |
| 4565 | + 'bottom' => 0, | |
| 4566 | + 'left' => 0, | |
| 4567 | + ], | |
| 4568 | + 'render_type' => 'template', | |
| 4569 | + 'selectors' => [ | |
| 4570 | + '{{WRAPPER}} .king-addons-grid-item-content .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4571 | + ], | |
| 4572 | + ] | |
| 4573 | + ); | |
| 4574 | + | |
| 4575 | + $this->end_controls_section(); | |
| 4576 | + | |
| 4577 | + | |
| 4578 | + $this->start_controls_section( | |
| 4579 | + 'section_style_excerpt', | |
| 4580 | + [ | |
| 4581 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Excerpt', 'king-addons'), | |
| 4582 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4583 | + 'show_label' => false, | |
| 4584 | + ] | |
| 4585 | + ); | |
| 4586 | + | |
| 4587 | + $this->add_control( | |
| 4588 | + 'excerpt_color', | |
| 4589 | + [ | |
| 4590 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4591 | + 'type' => Controls_Manager::COLOR, | |
| 4592 | + 'default' => '#6A6A6A', | |
| 4593 | + 'selectors' => [ | |
| 4594 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'color: {{VALUE}}', | |
| 4595 | + ], | |
| 4596 | + ] | |
| 4597 | + ); | |
| 4598 | + | |
| 4599 | + $this->add_control( | |
| 4600 | + 'excerpt_dropcap_color', | |
| 4601 | + [ | |
| 4602 | + 'label' => esc_html__('DropCap Color', 'king-addons'), | |
| 4603 | + 'type' => Controls_Manager::COLOR, | |
| 4604 | + 'default' => '#3a3a3a', | |
| 4605 | + 'selectors' => [ | |
| 4606 | + '{{WRAPPER}} .king-addons-grid-item-excerpt.king-addons-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}', | |
| 4607 | + ], | |
| 4608 | + ] | |
| 4609 | + ); | |
| 4610 | + | |
| 4611 | + $this->add_control( | |
| 4612 | + 'excerpt_bg_color', | |
| 4613 | + [ | |
| 4614 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4615 | + 'type' => Controls_Manager::COLOR, | |
| 4616 | + 'selectors' => [ | |
| 4617 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'background-color: {{VALUE}}', | |
| 4618 | + ] | |
| 4619 | + ] | |
| 4620 | + ); | |
| 4621 | + | |
| 4622 | + $this->add_control( | |
| 4623 | + 'excerpt_border_color', | |
| 4624 | + [ | |
| 4625 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4626 | + 'type' => Controls_Manager::COLOR, | |
| 4627 | + 'default' => '#E8E8E8', | |
| 4628 | + 'selectors' => [ | |
| 4629 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-color: {{VALUE}}', | |
| 4630 | + ], | |
| 4631 | + 'separator' => 'after', | |
| 4632 | + ] | |
| 4633 | + ); | |
| 4634 | + | |
| 4635 | + $this->add_group_control( | |
| 4636 | + Group_Control_Typography::get_type(), | |
| 4637 | + [ | |
| 4638 | + 'name' => 'excerpt_typography', | |
| 4639 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-excerpt' | |
| 4640 | + ] | |
| 4641 | + ); | |
| 4642 | + | |
| 4643 | + $this->add_group_control( | |
| 4644 | + Group_Control_Typography::get_type(), | |
| 4645 | + [ | |
| 4646 | + 'name' => 'excerpt_dropcap_typography', | |
| 4647 | + 'label' => esc_html__('Drop Cap Typography', 'king-addons'), | |
| 4648 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-excerpt.king-addons-enable-dropcap p:first-child:first-letter' | |
| 4649 | + ] | |
| 4650 | + ); | |
| 4651 | + | |
| 4652 | + $this->add_responsive_control( | |
| 4653 | + 'excerpt_justify', | |
| 4654 | + [ | |
| 4655 | + 'label' => esc_html__('Justify Text', 'king-addons'), | |
| 4656 | + 'type' => Controls_Manager::SWITCHER, | |
| 4657 | + 'default' => '', | |
| 4658 | + 'widescreen_default' => '', | |
| 4659 | + 'laptop_default' => '', | |
| 4660 | + 'tablet_extra_default' => '', | |
| 4661 | + 'tablet_default' => '', | |
| 4662 | + 'mobile_extra_default' => '', | |
| 4663 | + 'mobile_default' => '', | |
| 4664 | + 'selectors_dictionary' => [ | |
| 4665 | + '' => '', | |
| 4666 | + 'yes' => 'text-align: justify;' | |
| 4667 | + ], | |
| 4668 | + 'selectors' => [ | |
| 4669 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => '{{VALUE}}', | |
| 4670 | + ], | |
| 4671 | + 'render_type' => 'template', | |
| 4672 | + ] | |
| 4673 | + ); | |
| 4674 | + | |
| 4675 | + $this->add_control( | |
| 4676 | + 'excerpt_width', | |
| 4677 | + [ | |
| 4678 | + 'label' => esc_html__('Excerpt Width', 'king-addons'), | |
| 4679 | + 'type' => Controls_Manager::SLIDER, | |
| 4680 | + 'size_units' => ['%'], | |
| 4681 | + 'range' => [ | |
| 4682 | + '%' => [ | |
| 4683 | + 'min' => 10, | |
| 4684 | + 'max' => 100, | |
| 4685 | + ], | |
| 4686 | + ], | |
| 4687 | + 'default' => [ | |
| 4688 | + 'unit' => '%', | |
| 4689 | + 'size' => 100, | |
| 4690 | + ], | |
| 4691 | + 'selectors' => [ | |
| 4692 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'width: {{SIZE}}{{UNIT}};', | |
| 4693 | + ], | |
| 4694 | + 'separator' => 'before', | |
| 4695 | + ] | |
| 4696 | + ); | |
| 4697 | + | |
| 4698 | + $this->add_control( | |
| 4699 | + 'excerpt_border_type', | |
| 4700 | + [ | |
| 4701 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 4702 | + 'type' => Controls_Manager::SELECT, | |
| 4703 | + 'options' => [ | |
| 4704 | + 'none' => esc_html__('None', 'king-addons'), | |
| 4705 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4706 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4707 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4708 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4709 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4710 | + ], | |
| 4711 | + 'default' => 'none', | |
| 4712 | + 'selectors' => [ | |
| 4713 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-style: {{VALUE}};', | |
| 4714 | + ], | |
| 4715 | + 'render_type' => 'template', | |
| 4716 | + 'separator' => 'before', | |
| 4717 | + ] | |
| 4718 | + ); | |
| 4719 | + | |
| 4720 | + $this->add_control( | |
| 4721 | + 'excerpt_border_width', | |
| 4722 | + [ | |
| 4723 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 4724 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4725 | + 'size_units' => ['px'], | |
| 4726 | + 'default' => [ | |
| 4727 | + 'top' => 1, | |
| 4728 | + 'right' => 1, | |
| 4729 | + 'bottom' => 1, | |
| 4730 | + 'left' => 1, | |
| 4731 | + ], | |
| 4732 | + 'selectors' => [ | |
| 4733 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4734 | + ], | |
| 4735 | + 'render_type' => 'template', | |
| 4736 | + 'condition' => [ | |
| 4737 | + 'excerpt_border_type!' => 'none', | |
| 4738 | + ], | |
| 4739 | + ] | |
| 4740 | + ); | |
| 4741 | + | |
| 4742 | + $this->add_responsive_control( | |
| 4743 | + 'excerpt_padding', | |
| 4744 | + [ | |
| 4745 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 4746 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4747 | + 'size_units' => ['px', '%'], | |
| 4748 | + 'default' => [ | |
| 4749 | + 'top' => 0, | |
| 4750 | + 'right' => 0, | |
| 4751 | + 'bottom' => 0, | |
| 4752 | + 'left' => 0, | |
| 4753 | + ], | |
| 4754 | + 'selectors' => [ | |
| 4755 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4756 | + ], | |
| 4757 | + 'render_type' => 'template', | |
| 4758 | + 'separator' => 'before', | |
| 4759 | + ] | |
| 4760 | + ); | |
| 4761 | + | |
| 4762 | + $this->add_responsive_control( | |
| 4763 | + 'excerpt_margin', | |
| 4764 | + [ | |
| 4765 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4766 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4767 | + 'size_units' => ['px', '%'], | |
| 4768 | + 'default' => [ | |
| 4769 | + 'top' => 0, | |
| 4770 | + 'right' => 0, | |
| 4771 | + 'bottom' => 0, | |
| 4772 | + 'left' => 0, | |
| 4773 | + ], | |
| 4774 | + 'render_type' => 'template', | |
| 4775 | + 'selectors' => [ | |
| 4776 | + '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4777 | + ], | |
| 4778 | + ] | |
| 4779 | + ); | |
| 4780 | + | |
| 4781 | + $this->end_controls_section(); | |
| 4782 | + | |
| 4783 | + | |
| 4784 | + $this->start_controls_section( | |
| 4785 | + 'section_style_date', | |
| 4786 | + [ | |
| 4787 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Date', 'king-addons'), | |
| 4788 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 4789 | + 'show_label' => false, | |
| 4790 | + ] | |
| 4791 | + ); | |
| 4792 | + | |
| 4793 | + $this->add_control( | |
| 4794 | + 'date_color', | |
| 4795 | + [ | |
| 4796 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 4797 | + 'type' => Controls_Manager::COLOR, | |
| 4798 | + 'default' => '#9C9C9C', | |
| 4799 | + 'selectors' => [ | |
| 4800 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block' => 'color: {{VALUE}}', | |
| 4801 | + ], | |
| 4802 | + ] | |
| 4803 | + ); | |
| 4804 | + | |
| 4805 | + $this->add_control( | |
| 4806 | + 'date_bg_color', | |
| 4807 | + [ | |
| 4808 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 4809 | + 'type' => Controls_Manager::COLOR, | |
| 4810 | + 'selectors' => [ | |
| 4811 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'background-color: {{VALUE}}', | |
| 4812 | + ] | |
| 4813 | + ] | |
| 4814 | + ); | |
| 4815 | + | |
| 4816 | + $this->add_control( | |
| 4817 | + 'date_border_color', | |
| 4818 | + [ | |
| 4819 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 4820 | + 'type' => Controls_Manager::COLOR, | |
| 4821 | + 'default' => '#E8E8E8', | |
| 4822 | + 'selectors' => [ | |
| 4823 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-color: {{VALUE}}', | |
| 4824 | + ] | |
| 4825 | + ] | |
| 4826 | + ); | |
| 4827 | + | |
| 4828 | + $this->add_control( | |
| 4829 | + 'date_extra_text_color', | |
| 4830 | + [ | |
| 4831 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 4832 | + 'type' => Controls_Manager::COLOR, | |
| 4833 | + 'default' => '#9C9C9C', | |
| 4834 | + 'selectors' => [ | |
| 4835 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 4836 | + ], | |
| 4837 | + ] | |
| 4838 | + ); | |
| 4839 | + | |
| 4840 | + $this->add_control( | |
| 4841 | + 'date_extra_icon_color', | |
| 4842 | + [ | |
| 4843 | + 'label' => esc_html__('Extra Icon Color', 'king-addons'), | |
| 4844 | + 'type' => Controls_Manager::COLOR, | |
| 4845 | + 'default' => '#9C9C9C', | |
| 4846 | + 'selectors' => [ | |
| 4847 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}', | |
| 4848 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}' | |
| 4849 | + ], | |
| 4850 | + 'separator' => 'after', | |
| 4851 | + ] | |
| 4852 | + ); | |
| 4853 | + | |
| 4854 | + $this->add_group_control( | |
| 4855 | + Group_Control_Typography::get_type(), | |
| 4856 | + [ | |
| 4857 | + 'name' => 'date_typography', | |
| 4858 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-date, {{WRAPPER}} .king-addons-grid-item-date span' | |
| 4859 | + ] | |
| 4860 | + ); | |
| 4861 | + | |
| 4862 | + $this->add_control( | |
| 4863 | + 'date_border_type', | |
| 4864 | + [ | |
| 4865 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 4866 | + 'type' => Controls_Manager::SELECT, | |
| 4867 | + 'options' => [ | |
| 4868 | + 'none' => esc_html__('None', 'king-addons'), | |
| 4869 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 4870 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 4871 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 4872 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 4873 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 4874 | + ], | |
| 4875 | + 'default' => 'none', | |
| 4876 | + 'selectors' => [ | |
| 4877 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-style: {{VALUE}};', | |
| 4878 | + ], | |
| 4879 | + 'render_type' => 'template', | |
| 4880 | + 'separator' => 'before', | |
| 4881 | + ] | |
| 4882 | + ); | |
| 4883 | + | |
| 4884 | + $this->add_control( | |
| 4885 | + 'date_border_width', | |
| 4886 | + [ | |
| 4887 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 4888 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4889 | + 'size_units' => ['px'], | |
| 4890 | + 'default' => [ | |
| 4891 | + 'top' => 1, | |
| 4892 | + 'right' => 1, | |
| 4893 | + 'bottom' => 1, | |
| 4894 | + 'left' => 1, | |
| 4895 | + ], | |
| 4896 | + 'selectors' => [ | |
| 4897 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4898 | + ], | |
| 4899 | + 'render_type' => 'template', | |
| 4900 | + 'condition' => [ | |
| 4901 | + 'date_border_type!' => 'none', | |
| 4902 | + ], | |
| 4903 | + ] | |
| 4904 | + ); | |
| 4905 | + | |
| 4906 | + $this->add_control( | |
| 4907 | + 'date_text_spacing', | |
| 4908 | + [ | |
| 4909 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 4910 | + 'type' => Controls_Manager::SLIDER, | |
| 4911 | + 'size_units' => ['px'], | |
| 4912 | + 'range' => [ | |
| 4913 | + 'px' => [ | |
| 4914 | + 'min' => 0, | |
| 4915 | + 'max' => 25, | |
| 4916 | + ], | |
| 4917 | + ], | |
| 4918 | + 'default' => [ | |
| 4919 | + 'unit' => 'px', | |
| 4920 | + 'size' => 5, | |
| 4921 | + ], | |
| 4922 | + 'selectors' => [ | |
| 4923 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 4924 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 4925 | + ], | |
| 4926 | + 'separator' => 'before', | |
| 4927 | + ] | |
| 4928 | + ); | |
| 4929 | + | |
| 4930 | + $this->add_control( | |
| 4931 | + 'date_icon_spacing', | |
| 4932 | + [ | |
| 4933 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 4934 | + 'type' => Controls_Manager::SLIDER, | |
| 4935 | + 'size_units' => ['px'], | |
| 4936 | + 'range' => [ | |
| 4937 | + 'px' => [ | |
| 4938 | + 'min' => 0, | |
| 4939 | + 'max' => 25, | |
| 4940 | + ], | |
| 4941 | + ], | |
| 4942 | + 'default' => [ | |
| 4943 | + 'unit' => 'px', | |
| 4944 | + 'size' => 5, | |
| 4945 | + ], | |
| 4946 | + 'selectors' => [ | |
| 4947 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 4948 | + '{{WRAPPER}} .king-addons-grid-item-date .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 4949 | + ], | |
| 4950 | + ] | |
| 4951 | + ); | |
| 4952 | + | |
| 4953 | + $this->add_responsive_control( | |
| 4954 | + 'date_padding', | |
| 4955 | + [ | |
| 4956 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 4957 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4958 | + 'size_units' => ['px', '%'], | |
| 4959 | + 'default' => [ | |
| 4960 | + 'top' => 0, | |
| 4961 | + 'right' => 0, | |
| 4962 | + 'bottom' => 0, | |
| 4963 | + 'left' => 0, | |
| 4964 | + ], | |
| 4965 | + 'selectors' => [ | |
| 4966 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4967 | + ], | |
| 4968 | + 'render_type' => 'template', | |
| 4969 | + 'separator' => 'before', | |
| 4970 | + ] | |
| 4971 | + ); | |
| 4972 | + | |
| 4973 | + $this->add_responsive_control( | |
| 4974 | + 'date_margin', | |
| 4975 | + [ | |
| 4976 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 4977 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 4978 | + 'size_units' => ['px', '%'], | |
| 4979 | + 'default' => [ | |
| 4980 | + 'top' => 0, | |
| 4981 | + 'right' => 7, | |
| 4982 | + 'bottom' => 0, | |
| 4983 | + 'left' => 0, | |
| 4984 | + ], | |
| 4985 | + 'render_type' => 'template', | |
| 4986 | + 'selectors' => [ | |
| 4987 | + '{{WRAPPER}} .king-addons-grid-item-date .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 4988 | + ], | |
| 4989 | + ] | |
| 4990 | + ); | |
| 4991 | + | |
| 4992 | + $this->end_controls_section(); | |
| 4993 | + | |
| 4994 | + | |
| 4995 | + $this->start_controls_section( | |
| 4996 | + 'section_style_time', | |
| 4997 | + [ | |
| 4998 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Time', 'king-addons'), | |
| 4999 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 5000 | + 'show_label' => false, | |
| 5001 | + ] | |
| 5002 | + ); | |
| 5003 | + | |
| 5004 | + $this->add_control( | |
| 5005 | + 'time_color', | |
| 5006 | + [ | |
| 5007 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 5008 | + 'type' => Controls_Manager::COLOR, | |
| 5009 | + 'default' => '#9C9C9C', | |
| 5010 | + 'selectors' => [ | |
| 5011 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block' => 'color: {{VALUE}}', | |
| 5012 | + ], | |
| 5013 | + ] | |
| 5014 | + ); | |
| 5015 | + | |
| 5016 | + $this->add_control( | |
| 5017 | + 'time_bg_color', | |
| 5018 | + [ | |
| 5019 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 5020 | + 'type' => Controls_Manager::COLOR, | |
| 5021 | + 'selectors' => [ | |
| 5022 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'background-color: {{VALUE}}', | |
| 5023 | + ] | |
| 5024 | + ] | |
| 5025 | + ); | |
| 5026 | + | |
| 5027 | + $this->add_control( | |
| 5028 | + 'time_border_color', | |
| 5029 | + [ | |
| 5030 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 5031 | + 'type' => Controls_Manager::COLOR, | |
| 5032 | + 'default' => '#E8E8E8', | |
| 5033 | + 'selectors' => [ | |
| 5034 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-color: {{VALUE}}', | |
| 5035 | + ], | |
| 5036 | + ] | |
| 5037 | + ); | |
| 5038 | + | |
| 5039 | + $this->add_control( | |
| 5040 | + 'time_extra_text_color', | |
| 5041 | + [ | |
| 5042 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 5043 | + 'type' => Controls_Manager::COLOR, | |
| 5044 | + 'default' => '#9C9C9C', | |
| 5045 | + 'selectors' => [ | |
| 5046 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 5047 | + ], | |
| 5048 | + ] | |
| 5049 | + ); | |
| 5050 | + | |
| 5051 | + $this->add_control( | |
| 5052 | + 'time_extra_icon_color', | |
| 5053 | + [ | |
| 5054 | + 'label' => esc_html__('Extra Icon Color', 'king-addons'), | |
| 5055 | + 'type' => Controls_Manager::COLOR, | |
| 5056 | + 'default' => '#9C9C9C', | |
| 5057 | + 'selectors' => [ | |
| 5058 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}', | |
| 5059 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}' | |
| 5060 | + ], | |
| 5061 | + 'separator' => 'after', | |
| 5062 | + ] | |
| 5063 | + ); | |
| 5064 | + | |
| 5065 | + $this->add_group_control( | |
| 5066 | + Group_Control_Typography::get_type(), | |
| 5067 | + [ | |
| 5068 | + 'name' => 'time_typography', | |
| 5069 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-time' | |
| 5070 | + ] | |
| 5071 | + ); | |
| 5072 | + | |
| 5073 | + $this->add_control( | |
| 5074 | + 'time_border_type', | |
| 5075 | + [ | |
| 5076 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 5077 | + 'type' => Controls_Manager::SELECT, | |
| 5078 | + 'options' => [ | |
| 5079 | + 'none' => esc_html__('None', 'king-addons'), | |
| 5080 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 5081 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 5082 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 5083 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 5084 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 5085 | + ], | |
| 5086 | + 'default' => 'none', | |
| 5087 | + 'selectors' => [ | |
| 5088 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-style: {{VALUE}};', | |
| 5089 | + ], | |
| 5090 | + 'render_type' => 'template', | |
| 5091 | + 'separator' => 'before', | |
| 5092 | + ] | |
| 5093 | + ); | |
| 5094 | + | |
| 5095 | + $this->add_control( | |
| 5096 | + 'time_border_width', | |
| 5097 | + [ | |
| 5098 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 5099 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5100 | + 'size_units' => ['px'], | |
| 5101 | + 'default' => [ | |
| 5102 | + 'top' => 1, | |
| 5103 | + 'right' => 1, | |
| 5104 | + 'bottom' => 1, | |
| 5105 | + 'left' => 1, | |
| 5106 | + ], | |
| 5107 | + 'selectors' => [ | |
| 5108 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5109 | + ], | |
| 5110 | + 'render_type' => 'template', | |
| 5111 | + 'condition' => [ | |
| 5112 | + 'time_border_type!' => 'none', | |
| 5113 | + ], | |
| 5114 | + ] | |
| 5115 | + ); | |
| 5116 | + | |
| 5117 | + $this->add_control( | |
| 5118 | + 'time_text_spacing', | |
| 5119 | + [ | |
| 5120 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 5121 | + 'type' => Controls_Manager::SLIDER, | |
| 5122 | + 'size_units' => ['px'], | |
| 5123 | + 'range' => [ | |
| 5124 | + 'px' => [ | |
| 5125 | + 'min' => 0, | |
| 5126 | + 'max' => 25, | |
| 5127 | + ], | |
| 5128 | + ], | |
| 5129 | + 'default' => [ | |
| 5130 | + 'unit' => 'px', | |
| 5131 | + 'size' => 5, | |
| 5132 | + ], | |
| 5133 | + 'selectors' => [ | |
| 5134 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 5135 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 5136 | + ], | |
| 5137 | + 'separator' => 'before', | |
| 5138 | + ] | |
| 5139 | + ); | |
| 5140 | + | |
| 5141 | + $this->add_control( | |
| 5142 | + 'time_icon_spacing', | |
| 5143 | + [ | |
| 5144 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 5145 | + 'type' => Controls_Manager::SLIDER, | |
| 5146 | + 'size_units' => ['px'], | |
| 5147 | + 'range' => [ | |
| 5148 | + 'px' => [ | |
| 5149 | + 'min' => 0, | |
| 5150 | + 'max' => 25, | |
| 5151 | + ], | |
| 5152 | + ], | |
| 5153 | + 'default' => [ | |
| 5154 | + 'unit' => 'px', | |
| 5155 | + 'size' => 5, | |
| 5156 | + ], | |
| 5157 | + 'selectors' => [ | |
| 5158 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 5159 | + '{{WRAPPER}} .king-addons-grid-item-time .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 5160 | + ], | |
| 5161 | + ] | |
| 5162 | + ); | |
| 5163 | + | |
| 5164 | + $this->add_responsive_control( | |
| 5165 | + 'time_padding', | |
| 5166 | + [ | |
| 5167 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 5168 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5169 | + 'size_units' => ['px', '%'], | |
| 5170 | + 'default' => [ | |
| 5171 | + 'top' => 0, | |
| 5172 | + 'right' => 0, | |
| 5173 | + 'bottom' => 0, | |
| 5174 | + 'left' => 0, | |
| 5175 | + ], | |
| 5176 | + 'selectors' => [ | |
| 5177 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5178 | + ], | |
| 5179 | + 'render_type' => 'template', | |
| 5180 | + 'separator' => 'before', | |
| 5181 | + ] | |
| 5182 | + ); | |
| 5183 | + | |
| 5184 | + $this->add_responsive_control( | |
| 5185 | + 'time_margin', | |
| 5186 | + [ | |
| 5187 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 5188 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5189 | + 'size_units' => ['px', '%'], | |
| 5190 | + 'default' => [ | |
| 5191 | + 'top' => 0, | |
| 5192 | + 'right' => 0, | |
| 5193 | + 'bottom' => 0, | |
| 5194 | + 'left' => 0, | |
| 5195 | + ], | |
| 5196 | + 'selectors' => [ | |
| 5197 | + '{{WRAPPER}} .king-addons-grid-item-time .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5198 | + ], | |
| 5199 | + 'render_type' => 'template', | |
| 5200 | + ] | |
| 5201 | + ); | |
| 5202 | + | |
| 5203 | + $this->end_controls_section(); | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + $this->start_controls_section( | |
| 5207 | + 'section_style_author', | |
| 5208 | + [ | |
| 5209 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Author', 'king-addons'), | |
| 5210 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 5211 | + 'show_label' => false, | |
| 5212 | + ] | |
| 5213 | + ); | |
| 5214 | + | |
| 5215 | + $this->start_controls_tabs('tabs_grid_author_style'); | |
| 5216 | + | |
| 5217 | + $this->start_controls_tab( | |
| 5218 | + 'tab_grid_author_normal', | |
| 5219 | + [ | |
| 5220 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 5221 | + ] | |
| 5222 | + ); | |
| 5223 | + | |
| 5224 | + $this->add_control( | |
| 5225 | + 'author_color', | |
| 5226 | + [ | |
| 5227 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 5228 | + 'type' => Controls_Manager::COLOR, | |
| 5229 | + 'default' => '#9C9C9C', | |
| 5230 | + 'selectors' => [ | |
| 5231 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'color: {{VALUE}}', | |
| 5232 | + ], | |
| 5233 | + ] | |
| 5234 | + ); | |
| 5235 | + | |
| 5236 | + $this->add_control( | |
| 5237 | + 'author_bg_color', | |
| 5238 | + [ | |
| 5239 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 5240 | + 'type' => Controls_Manager::COLOR, | |
| 5241 | + 'selectors' => [ | |
| 5242 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'background-color: {{VALUE}}', | |
| 5243 | + ] | |
| 5244 | + ] | |
| 5245 | + ); | |
| 5246 | + | |
| 5247 | + $this->add_control( | |
| 5248 | + 'author_border_color', | |
| 5249 | + [ | |
| 5250 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 5251 | + 'type' => Controls_Manager::COLOR, | |
| 5252 | + 'default' => '#E8E8E8', | |
| 5253 | + 'selectors' => [ | |
| 5254 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-color: {{VALUE}}', | |
| 5255 | + ], | |
| 5256 | + ] | |
| 5257 | + ); | |
| 5258 | + | |
| 5259 | + $this->add_control( | |
| 5260 | + 'author_extra_text_color', | |
| 5261 | + [ | |
| 5262 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 5263 | + 'type' => Controls_Manager::COLOR, | |
| 5264 | + 'default' => '#9C9C9C', | |
| 5265 | + 'selectors' => [ | |
| 5266 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 5267 | + ], | |
| 5268 | + 'separator' => 'after', | |
| 5269 | + ] | |
| 5270 | + ); | |
| 5271 | + | |
| 5272 | + $this->end_controls_tab(); | |
| 5273 | + | |
| 5274 | + $this->start_controls_tab( | |
| 5275 | + 'tab_grid_author_hover', | |
| 5276 | + [ | |
| 5277 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 5278 | + ] | |
| 5279 | + ); | |
| 5280 | + | |
| 5281 | + $this->add_control( | |
| 5282 | + 'author_color_hr', | |
| 5283 | + [ | |
| 5284 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 5285 | + 'type' => Controls_Manager::COLOR, | |
| 5286 | + 'default' => '#5B03FF', | |
| 5287 | + 'selectors' => [ | |
| 5288 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'color: {{VALUE}}', | |
| 5289 | + ], | |
| 5290 | + ] | |
| 5291 | + ); | |
| 5292 | + | |
| 5293 | + $this->add_control( | |
| 5294 | + 'author_bg_color_hr', | |
| 5295 | + [ | |
| 5296 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 5297 | + 'type' => Controls_Manager::COLOR, | |
| 5298 | + 'selectors' => [ | |
| 5299 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 5300 | + ] | |
| 5301 | + ] | |
| 5302 | + ); | |
| 5303 | + | |
| 5304 | + $this->add_control( | |
| 5305 | + 'author_border_color_hr', | |
| 5306 | + [ | |
| 5307 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 5308 | + 'type' => Controls_Manager::COLOR, | |
| 5309 | + 'default' => '#E8E8E8', | |
| 5310 | + 'selectors' => [ | |
| 5311 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 5312 | + ], | |
| 5313 | + 'separator' => 'after', | |
| 5314 | + ] | |
| 5315 | + ); | |
| 5316 | + | |
| 5317 | + $this->end_controls_tab(); | |
| 5318 | + | |
| 5319 | + $this->end_controls_tabs(); | |
| 5320 | + | |
| 5321 | + $this->add_control( | |
| 5322 | + 'author_transition_duration', | |
| 5323 | + [ | |
| 5324 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 5325 | + 'type' => Controls_Manager::NUMBER, | |
| 5326 | + 'default' => 0.1, | |
| 5327 | + 'min' => 0, | |
| 5328 | + 'max' => 5, | |
| 5329 | + 'step' => 0.1, | |
| 5330 | + 'selectors' => [ | |
| 5331 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 5332 | + ], | |
| 5333 | + 'separator' => 'after', | |
| 5334 | + ] | |
| 5335 | + ); | |
| 5336 | + | |
| 5337 | + $this->add_group_control( | |
| 5338 | + Group_Control_Typography::get_type(), | |
| 5339 | + [ | |
| 5340 | + 'name' => 'author_typography', | |
| 5341 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-author, {{WRAPPER}} .king-addons-grid-item-author .inner-block a' | |
| 5342 | + ] | |
| 5343 | + ); | |
| 5344 | + | |
| 5345 | + $this->add_control( | |
| 5346 | + 'author_border_type', | |
| 5347 | + [ | |
| 5348 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 5349 | + 'type' => Controls_Manager::SELECT, | |
| 5350 | + 'options' => [ | |
| 5351 | + 'none' => esc_html__('None', 'king-addons'), | |
| 5352 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 5353 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 5354 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 5355 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 5356 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 5357 | + ], | |
| 5358 | + 'default' => 'none', | |
| 5359 | + 'selectors' => [ | |
| 5360 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-style: {{VALUE}};', | |
| 5361 | + ], | |
| 5362 | + 'render_type' => 'template', | |
| 5363 | + 'separator' => 'before', | |
| 5364 | + ] | |
| 5365 | + ); | |
| 5366 | + | |
| 5367 | + $this->add_control( | |
| 5368 | + 'author_border_width', | |
| 5369 | + [ | |
| 5370 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 5371 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5372 | + 'size_units' => ['px'], | |
| 5373 | + 'default' => [ | |
| 5374 | + 'top' => 1, | |
| 5375 | + 'right' => 1, | |
| 5376 | + 'bottom' => 1, | |
| 5377 | + 'left' => 1, | |
| 5378 | + ], | |
| 5379 | + 'selectors' => [ | |
| 5380 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5381 | + ], | |
| 5382 | + 'render_type' => 'template', | |
| 5383 | + 'condition' => [ | |
| 5384 | + 'author_border_type!' => 'none', | |
| 5385 | + ], | |
| 5386 | + ] | |
| 5387 | + ); | |
| 5388 | + | |
| 5389 | + $this->add_control( | |
| 5390 | + 'author_border_radius', | |
| 5391 | + [ | |
| 5392 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 5393 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5394 | + 'size_units' => ['px'], | |
| 5395 | + 'default' => [ | |
| 5396 | + 'top' => 0, | |
| 5397 | + 'right' => 0, | |
| 5398 | + 'bottom' => 0, | |
| 5399 | + 'left' => 0, | |
| 5400 | + ], | |
| 5401 | + 'selectors' => [ | |
| 5402 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5403 | + ] | |
| 5404 | + ] | |
| 5405 | + ); | |
| 5406 | + | |
| 5407 | + $this->add_control( | |
| 5408 | + 'author_text_spacing', | |
| 5409 | + [ | |
| 5410 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 5411 | + 'type' => Controls_Manager::SLIDER, | |
| 5412 | + 'size_units' => ['px'], | |
| 5413 | + 'range' => [ | |
| 5414 | + 'px' => [ | |
| 5415 | + 'min' => 0, | |
| 5416 | + 'max' => 25, | |
| 5417 | + ], | |
| 5418 | + ], | |
| 5419 | + 'default' => [ | |
| 5420 | + 'unit' => 'px', | |
| 5421 | + 'size' => 5, | |
| 5422 | + ], | |
| 5423 | + 'selectors' => [ | |
| 5424 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 5425 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 5426 | + ], | |
| 5427 | + 'separator' => 'before', | |
| 5428 | + ] | |
| 5429 | + ); | |
| 5430 | + | |
| 5431 | + $this->add_control( | |
| 5432 | + 'author_icon_spacing', | |
| 5433 | + [ | |
| 5434 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 5435 | + 'type' => Controls_Manager::SLIDER, | |
| 5436 | + 'size_units' => ['px'], | |
| 5437 | + 'range' => [ | |
| 5438 | + 'px' => [ | |
| 5439 | + 'min' => 0, | |
| 5440 | + 'max' => 25, | |
| 5441 | + ], | |
| 5442 | + ], | |
| 5443 | + 'default' => [ | |
| 5444 | + 'unit' => 'px', | |
| 5445 | + 'size' => 5, | |
| 5446 | + ], | |
| 5447 | + 'selectors' => [ | |
| 5448 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 5449 | + '{{WRAPPER}} .king-addons-grid-item-author .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 5450 | + ], | |
| 5451 | + ] | |
| 5452 | + ); | |
| 5453 | + | |
| 5454 | + $this->add_control( | |
| 5455 | + 'author_avatar_spacing', | |
| 5456 | + [ | |
| 5457 | + 'label' => esc_html__('Avatar Spacing', 'king-addons'), | |
| 5458 | + 'type' => Controls_Manager::SLIDER, | |
| 5459 | + 'size_units' => ['px'], | |
| 5460 | + 'range' => [ | |
| 5461 | + 'px' => [ | |
| 5462 | + 'min' => 0, | |
| 5463 | + 'max' => 25, | |
| 5464 | + ], | |
| 5465 | + ], | |
| 5466 | + 'default' => [ | |
| 5467 | + 'unit' => 'px', | |
| 5468 | + 'size' => 5, | |
| 5469 | + ], | |
| 5470 | + 'selectors' => [ | |
| 5471 | + '{{WRAPPER}} .king-addons-grid-item-author img' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 5472 | + ], | |
| 5473 | + ] | |
| 5474 | + ); | |
| 5475 | + | |
| 5476 | + $this->add_responsive_control( | |
| 5477 | + 'author_padding', | |
| 5478 | + [ | |
| 5479 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 5480 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5481 | + 'size_units' => ['px', '%'], | |
| 5482 | + 'default' => [ | |
| 5483 | + 'top' => 0, | |
| 5484 | + 'right' => 0, | |
| 5485 | + 'bottom' => 0, | |
| 5486 | + 'left' => 0, | |
| 5487 | + ], | |
| 5488 | + 'selectors' => [ | |
| 5489 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5490 | + ], | |
| 5491 | + 'render_type' => 'template', | |
| 5492 | + 'separator' => 'before', | |
| 5493 | + ] | |
| 5494 | + ); | |
| 5495 | + | |
| 5496 | + $this->add_responsive_control( | |
| 5497 | + 'author_margin', | |
| 5498 | + [ | |
| 5499 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 5500 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5501 | + 'size_units' => ['px', '%'], | |
| 5502 | + 'default' => [ | |
| 5503 | + 'top' => 0, | |
| 5504 | + 'right' => 0, | |
| 5505 | + 'bottom' => 0, | |
| 5506 | + 'left' => 0, | |
| 5507 | + ], | |
| 5508 | + 'render_type' => 'template', | |
| 5509 | + 'selectors' => [ | |
| 5510 | + '{{WRAPPER}} .king-addons-grid-item-author .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5511 | + ], | |
| 5512 | + ] | |
| 5513 | + ); | |
| 5514 | + | |
| 5515 | + $this->end_controls_section(); | |
| 5516 | + | |
| 5517 | + | |
| 5518 | + $this->start_controls_section( | |
| 5519 | + 'section_style_comments', | |
| 5520 | + [ | |
| 5521 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Comments', 'king-addons'), | |
| 5522 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 5523 | + 'show_label' => false, | |
| 5524 | + ] | |
| 5525 | + ); | |
| 5526 | + | |
| 5527 | + $this->start_controls_tabs('tabs_grid_comments_style'); | |
| 5528 | + | |
| 5529 | + $this->start_controls_tab( | |
| 5530 | + 'tab_grid_comments_normal', | |
| 5531 | + [ | |
| 5532 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 5533 | + ] | |
| 5534 | + ); | |
| 5535 | + | |
| 5536 | + $this->add_control( | |
| 5537 | + 'comments_color', | |
| 5538 | + [ | |
| 5539 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 5540 | + 'type' => Controls_Manager::COLOR, | |
| 5541 | + 'default' => '#9C9C9C', | |
| 5542 | + 'selectors' => [ | |
| 5543 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'color: {{VALUE}}', | |
| 5544 | + ], | |
| 5545 | + ] | |
| 5546 | + ); | |
| 5547 | + | |
| 5548 | + $this->add_control( | |
| 5549 | + 'comments_bg_color', | |
| 5550 | + [ | |
| 5551 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 5552 | + 'type' => Controls_Manager::COLOR, | |
| 5553 | + 'selectors' => [ | |
| 5554 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'background-color: {{VALUE}}', | |
| 5555 | + ] | |
| 5556 | + ] | |
| 5557 | + ); | |
| 5558 | + | |
| 5559 | + $this->add_control( | |
| 5560 | + 'comments_border_color', | |
| 5561 | + [ | |
| 5562 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 5563 | + 'type' => Controls_Manager::COLOR, | |
| 5564 | + 'default' => '#E8E8E8', | |
| 5565 | + 'selectors' => [ | |
| 5566 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-color: {{VALUE}}', | |
| 5567 | + ], | |
| 5568 | + ] | |
| 5569 | + ); | |
| 5570 | + | |
| 5571 | + $this->add_control( | |
| 5572 | + 'comments_extra_text_color', | |
| 5573 | + [ | |
| 5574 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 5575 | + 'type' => Controls_Manager::COLOR, | |
| 5576 | + 'default' => '#9C9C9C', | |
| 5577 | + 'selectors' => [ | |
| 5578 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 5579 | + ], | |
| 5580 | + 'separator' => 'after', | |
| 5581 | + ] | |
| 5582 | + ); | |
| 5583 | + | |
| 5584 | + $this->end_controls_tab(); | |
| 5585 | + | |
| 5586 | + $this->start_controls_tab( | |
| 5587 | + 'tab_grid_comments_hover', | |
| 5588 | + [ | |
| 5589 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 5590 | + ] | |
| 5591 | + ); | |
| 5592 | + | |
| 5593 | + $this->add_control( | |
| 5594 | + 'comments_color_hr', | |
| 5595 | + [ | |
| 5596 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 5597 | + 'type' => Controls_Manager::COLOR, | |
| 5598 | + 'default' => '#5B03FF', | |
| 5599 | + 'selectors' => [ | |
| 5600 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'color: {{VALUE}}', | |
| 5601 | + ], | |
| 5602 | + ] | |
| 5603 | + ); | |
| 5604 | + | |
| 5605 | + $this->add_control( | |
| 5606 | + 'comments_bg_color_hr', | |
| 5607 | + [ | |
| 5608 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 5609 | + 'type' => Controls_Manager::COLOR, | |
| 5610 | + 'selectors' => [ | |
| 5611 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 5612 | + ] | |
| 5613 | + ] | |
| 5614 | + ); | |
| 5615 | + | |
| 5616 | + $this->add_control( | |
| 5617 | + 'comments_border_color_hr', | |
| 5618 | + [ | |
| 5619 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 5620 | + 'type' => Controls_Manager::COLOR, | |
| 5621 | + 'default' => '#E8E8E8', | |
| 5622 | + 'selectors' => [ | |
| 5623 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 5624 | + ], | |
| 5625 | + 'separator' => 'after', | |
| 5626 | + ] | |
| 5627 | + ); | |
| 5628 | + | |
| 5629 | + $this->end_controls_tab(); | |
| 5630 | + | |
| 5631 | + $this->end_controls_tabs(); | |
| 5632 | + | |
| 5633 | + $this->add_control( | |
| 5634 | + 'comments_transition_duration', | |
| 5635 | + [ | |
| 5636 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 5637 | + 'type' => Controls_Manager::NUMBER, | |
| 5638 | + 'default' => 0.1, | |
| 5639 | + 'min' => 0, | |
| 5640 | + 'max' => 5, | |
| 5641 | + 'step' => 0.1, | |
| 5642 | + 'selectors' => [ | |
| 5643 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 5644 | + ], | |
| 5645 | + 'separator' => 'after', | |
| 5646 | + ] | |
| 5647 | + ); | |
| 5648 | + | |
| 5649 | + $this->add_group_control( | |
| 5650 | + Group_Control_Typography::get_type(), | |
| 5651 | + [ | |
| 5652 | + 'name' => 'comments_typography', | |
| 5653 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-comments' | |
| 5654 | + ] | |
| 5655 | + ); | |
| 5656 | + | |
| 5657 | + $this->add_control( | |
| 5658 | + 'comments_border_type', | |
| 5659 | + [ | |
| 5660 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 5661 | + 'type' => Controls_Manager::SELECT, | |
| 5662 | + 'options' => [ | |
| 5663 | + 'none' => esc_html__('None', 'king-addons'), | |
| 5664 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 5665 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 5666 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 5667 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 5668 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 5669 | + ], | |
| 5670 | + 'default' => 'none', | |
| 5671 | + 'selectors' => [ | |
| 5672 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-style: {{VALUE}};', | |
| 5673 | + ], | |
| 5674 | + 'render_type' => 'template', | |
| 5675 | + 'separator' => 'before', | |
| 5676 | + ] | |
| 5677 | + ); | |
| 5678 | + | |
| 5679 | + $this->add_control( | |
| 5680 | + 'comments_border_width', | |
| 5681 | + [ | |
| 5682 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 5683 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5684 | + 'size_units' => ['px'], | |
| 5685 | + 'default' => [ | |
| 5686 | + 'top' => 1, | |
| 5687 | + 'right' => 1, | |
| 5688 | + 'bottom' => 1, | |
| 5689 | + 'left' => 1, | |
| 5690 | + ], | |
| 5691 | + 'selectors' => [ | |
| 5692 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5693 | + ], | |
| 5694 | + 'render_type' => 'template', | |
| 5695 | + 'condition' => [ | |
| 5696 | + 'comments_border_type!' => 'none', | |
| 5697 | + ], | |
| 5698 | + ] | |
| 5699 | + ); | |
| 5700 | + | |
| 5701 | + $this->add_control( | |
| 5702 | + 'comments_text_spacing', | |
| 5703 | + [ | |
| 5704 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 5705 | + 'type' => Controls_Manager::SLIDER, | |
| 5706 | + 'size_units' => ['px'], | |
| 5707 | + 'range' => [ | |
| 5708 | + 'px' => [ | |
| 5709 | + 'min' => 0, | |
| 5710 | + 'max' => 25, | |
| 5711 | + ], | |
| 5712 | + ], | |
| 5713 | + 'default' => [ | |
| 5714 | + 'unit' => 'px', | |
| 5715 | + 'size' => 5, | |
| 5716 | + ], | |
| 5717 | + 'selectors' => [ | |
| 5718 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 5719 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 5720 | + ], | |
| 5721 | + 'separator' => 'before' | |
| 5722 | + ] | |
| 5723 | + ); | |
| 5724 | + | |
| 5725 | + $this->add_control( | |
| 5726 | + 'comments_icon_spacing', | |
| 5727 | + [ | |
| 5728 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 5729 | + 'type' => Controls_Manager::SLIDER, | |
| 5730 | + 'size_units' => ['px'], | |
| 5731 | + 'range' => [ | |
| 5732 | + 'px' => [ | |
| 5733 | + 'min' => 0, | |
| 5734 | + 'max' => 25, | |
| 5735 | + ], | |
| 5736 | + ], | |
| 5737 | + 'default' => [ | |
| 5738 | + 'unit' => 'px', | |
| 5739 | + 'size' => 5, | |
| 5740 | + ], | |
| 5741 | + 'selectors' => [ | |
| 5742 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 5743 | + '{{WRAPPER}} .king-addons-grid-item-comments .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 5744 | + ], | |
| 5745 | + ] | |
| 5746 | + ); | |
| 5747 | + | |
| 5748 | + $this->add_responsive_control( | |
| 5749 | + 'comments_padding', | |
| 5750 | + [ | |
| 5751 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 5752 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5753 | + 'size_units' => ['px', '%'], | |
| 5754 | + 'default' => [ | |
| 5755 | + 'top' => 0, | |
| 5756 | + 'right' => 0, | |
| 5757 | + 'bottom' => 0, | |
| 5758 | + 'left' => 0, | |
| 5759 | + ], | |
| 5760 | + 'selectors' => [ | |
| 5761 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5762 | + ], | |
| 5763 | + 'render_type' => 'template', | |
| 5764 | + 'separator' => 'before', | |
| 5765 | + ] | |
| 5766 | + ); | |
| 5767 | + | |
| 5768 | + $this->add_responsive_control( | |
| 5769 | + 'comments_margin', | |
| 5770 | + [ | |
| 5771 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 5772 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5773 | + 'size_units' => ['px', '%'], | |
| 5774 | + 'default' => [ | |
| 5775 | + 'top' => 0, | |
| 5776 | + 'right' => 0, | |
| 5777 | + 'bottom' => 0, | |
| 5778 | + 'left' => 0, | |
| 5779 | + ], | |
| 5780 | + 'selectors' => [ | |
| 5781 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5782 | + ], | |
| 5783 | + 'render_type' => 'template', | |
| 5784 | + ] | |
| 5785 | + ); | |
| 5786 | + | |
| 5787 | + $this->add_control( | |
| 5788 | + 'comments_radius', | |
| 5789 | + [ | |
| 5790 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 5791 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 5792 | + 'size_units' => ['px', '%'], | |
| 5793 | + 'default' => [ | |
| 5794 | + 'top' => 2, | |
| 5795 | + 'right' => 2, | |
| 5796 | + 'bottom' => 2, | |
| 5797 | + 'left' => 2, | |
| 5798 | + ], | |
| 5799 | + 'selectors' => [ | |
| 5800 | + '{{WRAPPER}} .king-addons-grid-item-comments .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 5801 | + ], | |
| 5802 | + 'separator' => 'before', | |
| 5803 | + ] | |
| 5804 | + ); | |
| 5805 | + | |
| 5806 | + $this->end_controls_section(); | |
| 5807 | + | |
| 5808 | + | |
| 5809 | + $this->start_controls_section( | |
| 5810 | + 'section_style_read_more', | |
| 5811 | + [ | |
| 5812 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Read More', 'king-addons'), | |
| 5813 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 5814 | + 'show_label' => false, | |
| 5815 | + ] | |
| 5816 | + ); | |
| 5817 | + | |
| 5818 | + $this->start_controls_tabs('tabs_grid_read_more_style'); | |
| 5819 | + | |
| 5820 | + $this->start_controls_tab( | |
| 5821 | + 'tab_grid_read_more_normal', | |
| 5822 | + [ | |
| 5823 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 5824 | + ] | |
| 5825 | + ); | |
| 5826 | + | |
| 5827 | + $this->add_group_control( | |
| 5828 | + Group_Control_Background::get_type(), | |
| 5829 | + [ | |
| 5830 | + 'name' => 'read_more_bg_color', | |
| 5831 | + 'label' => esc_html__('Background', 'king-addons'), | |
| 5832 | + 'types' => ['classic', 'gradient'], | |
| 5833 | + 'fields_options' => [ | |
| 5834 | + 'color' => [ | |
| 5835 | + 'default' => '#434900', | |
| 5836 | + ], | |
| 5837 | + ], | |
| 5838 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' | |
| 5839 | + ] | |
| 5840 | + ); | |
| 5841 | + | |
| 5842 | + $this->add_control( | |
| 5843 | + 'read_more_color', | |
| 5844 | + [ | |
| 5845 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 5846 | + 'type' => Controls_Manager::COLOR, | |
| 5847 | + 'default' => '#5B03FF', | |
| 5848 | + 'selectors' => [ | |
| 5849 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'color: {{VALUE}}', | |
| 5850 | + ], | |
| 5851 | + ] | |
| 5852 | + ); | |
| 5853 | + | |
| 5854 | + $this->add_control( | |
| 5855 | + 'read_more_border_color', | |
| 5856 | + [ | |
| 5857 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 5858 | + 'type' => Controls_Manager::COLOR, | |
| 5859 | + 'default' => '#E8E8E8', | |
| 5860 | + 'selectors' => [ | |
| 5861 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-color: {{VALUE}}', | |
| 5862 | + ], | |
| 5863 | + ] | |
| 5864 | + ); | |
| 5865 | + | |
| 5866 | + $this->add_group_control( | |
| 5867 | + Group_Control_Box_Shadow::get_type(), | |
| 5868 | + [ | |
| 5869 | + 'name' => 'read_more_box_shadow', | |
| 5870 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a', | |
| 5871 | + ] | |
| 5872 | + ); | |
| 5873 | + | |
| 5874 | + $this->end_controls_tab(); | |
| 5875 | + | |
| 5876 | + $this->start_controls_tab( | |
| 5877 | + 'tab_grid_read_more_hover', | |
| 5878 | + [ | |
| 5879 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 5880 | + ] | |
| 5881 | + ); | |
| 5882 | + | |
| 5883 | + $this->add_group_control( | |
| 5884 | + Group_Control_Background::get_type(), | |
| 5885 | + [ | |
| 5886 | + 'name' => 'read_more_bg_color_hr', | |
| 5887 | + 'label' => esc_html__('Background', 'king-addons'), | |
| 5888 | + 'types' => ['classic', 'gradient'], | |
| 5889 | + 'fields_options' => [ | |
| 5890 | + 'color' => [ | |
| 5891 | + 'default' => '#434900', | |
| 5892 | + ], | |
| 5893 | + ], | |
| 5894 | + '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' | |
| 5895 | + ] | |
| 5896 | + ); | |
| 5897 | + | |
| 5898 | + $this->add_control( | |
| 5899 | + 'read_more_color_hr', | |
| 5900 | + [ | |
| 5901 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 5902 | + 'type' => Controls_Manager::COLOR, | |
| 5903 | + 'default' => '#4D02D8', | |
| 5904 | + 'selectors' => [ | |
| 5905 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:hover' => 'color: {{VALUE}}', | |
| 5906 | + ], | |
| 5907 | + ] | |
| 5908 | + ); | |
| 5909 | + | |
| 5910 | + $this->add_control( | |
| 5911 | + 'read_more_border_color_hr', | |
| 5912 | + [ | |
| 5913 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 5914 | + 'type' => Controls_Manager::COLOR, | |
| 5915 | + 'default' => '#E8E8E8', | |
| 5916 | + 'selectors' => [ | |
| 5917 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 5918 | + ] | |
| 5919 | + ] | |
| 5920 | + ); | |
| 5921 | + | |
| 5922 | + $this->add_group_control( | |
| 5923 | + Group_Control_Box_Shadow::get_type(), | |
| 5924 | + [ | |
| 5925 | + 'name' => 'read_more_box_shadow_hr', | |
| 5926 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block :hover a', | |
| 5927 | + ] | |
| 5928 | + ); | |
| 5929 | + | |
| 5930 | + $this->end_controls_tab(); | |
| 5931 | + | |
| 5932 | + $this->end_controls_tabs(); | |
| 5933 | + | |
| 5934 | + $this->add_control( | |
| 5935 | + 'read_more_divider', | |
| 5936 | + [ | |
| 5937 | + 'type' => Controls_Manager::DIVIDER, | |
| 5938 | + 'style' => 'thick', | |
| 5939 | + ] | |
| 5940 | + ); | |
| 5941 | + | |
| 5942 | + $this->add_control_read_more_animation(); | |
| 5943 | + | |
| 5944 | + $this->add_control( | |
| 5945 | + 'read_more_transition_duration', | |
| 5946 | + [ | |
| 5947 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 5948 | + 'type' => Controls_Manager::NUMBER, | |
| 5949 | + 'default' => 0.1, | |
| 5950 | + 'min' => 0, | |
| 5951 | + 'max' => 5, | |
| 5952 | + 'step' => 0.1, | |
| 5953 | + 'selectors' => [ | |
| 5954 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 5955 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:before' => 'transition-duration: {{VALUE}}s', | |
| 5956 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a:after' => 'transition-duration: {{VALUE}}s', | |
| 5957 | + ], | |
| 5958 | + ] | |
| 5959 | + ); | |
| 5960 | + | |
| 5961 | + $this->add_control_read_more_animation_height(); | |
| 5962 | + | |
| 5963 | + $this->add_control( | |
| 5964 | + 'read_more_typo_divider', | |
| 5965 | + [ | |
| 5966 | + 'type' => Controls_Manager::DIVIDER, | |
| 5967 | + 'style' => 'thick', | |
| 5968 | + ] | |
| 5969 | + ); | |
| 5970 | + | |
| 5971 | + $this->add_group_control( | |
| 5972 | + Group_Control_Typography::get_type(), | |
| 5973 | + [ | |
| 5974 | + 'name' => 'read_more_typography', | |
| 5975 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-read-more a' | |
| 5976 | + ] | |
| 5977 | + ); | |
| 5978 | + | |
| 5979 | + $this->add_control( | |
| 5980 | + 'read_more_border_type', | |
| 5981 | + [ | |
| 5982 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 5983 | + 'type' => Controls_Manager::SELECT, | |
| 5984 | + 'options' => [ | |
| 5985 | + 'none' => esc_html__('None', 'king-addons'), | |
| 5986 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 5987 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 5988 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 5989 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 5990 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 5991 | + ], | |
| 5992 | + 'default' => 'none', | |
| 5993 | + 'selectors' => [ | |
| 5994 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-style: {{VALUE}};', | |
| 5995 | + ], | |
| 5996 | + 'render_type' => 'template', | |
| 5997 | + 'separator' => 'before', | |
| 5998 | + ] | |
| 5999 | + ); | |
| 6000 | + | |
| 6001 | + $this->add_control( | |
| 6002 | + 'read_more_border_width', | |
| 6003 | + [ | |
| 6004 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 6005 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6006 | + 'size_units' => ['px'], | |
| 6007 | + 'default' => [ | |
| 6008 | + 'top' => 1, | |
| 6009 | + 'right' => 1, | |
| 6010 | + 'bottom' => 1, | |
| 6011 | + 'left' => 1, | |
| 6012 | + ], | |
| 6013 | + 'selectors' => [ | |
| 6014 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6015 | + ], | |
| 6016 | + 'render_type' => 'template', | |
| 6017 | + 'condition' => [ | |
| 6018 | + 'read_more_border_type!' => 'none', | |
| 6019 | + ], | |
| 6020 | + ] | |
| 6021 | + ); | |
| 6022 | + | |
| 6023 | + $this->add_control( | |
| 6024 | + 'read_more_icon_spacing', | |
| 6025 | + [ | |
| 6026 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 6027 | + 'type' => Controls_Manager::SLIDER, | |
| 6028 | + 'size_units' => ['px'], | |
| 6029 | + 'range' => [ | |
| 6030 | + 'px' => [ | |
| 6031 | + 'min' => 0, | |
| 6032 | + 'max' => 25, | |
| 6033 | + ], | |
| 6034 | + ], | |
| 6035 | + 'default' => [ | |
| 6036 | + 'unit' => 'px', | |
| 6037 | + 'size' => 5, | |
| 6038 | + ], | |
| 6039 | + 'selectors' => [ | |
| 6040 | + '{{WRAPPER}} .king-addons-grid-item-read-more .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 6041 | + '{{WRAPPER}} .king-addons-grid-item-read-more .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 6042 | + ], | |
| 6043 | + 'separator' => 'before' | |
| 6044 | + ] | |
| 6045 | + ); | |
| 6046 | + | |
| 6047 | + $this->add_responsive_control( | |
| 6048 | + 'read_more_padding', | |
| 6049 | + [ | |
| 6050 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 6051 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6052 | + 'size_units' => ['px', '%'], | |
| 6053 | + 'default' => [ | |
| 6054 | + 'top' => 0, | |
| 6055 | + 'right' => 0, | |
| 6056 | + 'bottom' => 0, | |
| 6057 | + 'left' => 0, | |
| 6058 | + ], | |
| 6059 | + 'selectors' => [ | |
| 6060 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6061 | + ], | |
| 6062 | + 'render_type' => 'template', | |
| 6063 | + 'separator' => 'before', | |
| 6064 | + ] | |
| 6065 | + ); | |
| 6066 | + | |
| 6067 | + $this->add_responsive_control( | |
| 6068 | + 'read_more_margin', | |
| 6069 | + [ | |
| 6070 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 6071 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6072 | + 'size_units' => ['px', '%'], | |
| 6073 | + 'default' => [ | |
| 6074 | + 'top' => 0, | |
| 6075 | + 'right' => 0, | |
| 6076 | + 'bottom' => 0, | |
| 6077 | + 'left' => 0, | |
| 6078 | + ], | |
| 6079 | + 'selectors' => [ | |
| 6080 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6081 | + ], | |
| 6082 | + 'render_type' => 'template', | |
| 6083 | + ] | |
| 6084 | + ); | |
| 6085 | + | |
| 6086 | + $this->add_control( | |
| 6087 | + 'read_more_radius', | |
| 6088 | + [ | |
| 6089 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 6090 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6091 | + 'size_units' => ['px', '%'], | |
| 6092 | + 'default' => [ | |
| 6093 | + 'top' => 0, | |
| 6094 | + 'right' => 0, | |
| 6095 | + 'bottom' => 0, | |
| 6096 | + 'left' => 0, | |
| 6097 | + ], | |
| 6098 | + 'selectors' => [ | |
| 6099 | + '{{WRAPPER}} .king-addons-grid-item-read-more .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6100 | + ], | |
| 6101 | + 'separator' => 'before', | |
| 6102 | + ] | |
| 6103 | + ); | |
| 6104 | + | |
| 6105 | + $this->end_controls_section(); | |
| 6106 | + | |
| 6107 | + | |
| 6108 | + $this->add_section_style_likes(); | |
| 6109 | + | |
| 6110 | + | |
| 6111 | + $this->add_section_style_sharing(); | |
| 6112 | + | |
| 6113 | + // TODO | |
| 6114 | +// $this->add_section_style_lightbox(); | |
| 6115 | + | |
| 6116 | + $this->start_controls_section( | |
| 6117 | + 'section_style_filters', | |
| 6118 | + [ | |
| 6119 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Filters', 'king-addons'), | |
| 6120 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 6121 | + 'show_label' => false, | |
| 6122 | + 'condition' => [ | |
| 6123 | + 'layout_select!' => 'slider', | |
| 6124 | + 'layout_filters' => 'yes', | |
| 6125 | + ], | |
| 6126 | + ] | |
| 6127 | + ); | |
| 6128 | + | |
| 6129 | + $this->add_control( | |
| 6130 | + 'active_styles_notice', | |
| 6131 | + [ | |
| 6132 | + 'type' => Controls_Manager::RAW_HTML, | |
| 6133 | + 'raw' => esc_html__('Apply active filter styles from the hover tab.', 'king-addons'), | |
| 6134 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info' | |
| 6135 | + ] | |
| 6136 | + ); | |
| 6137 | + | |
| 6138 | + $this->start_controls_tabs('tabs_grid_filters_style'); | |
| 6139 | + | |
| 6140 | + $this->start_controls_tab( | |
| 6141 | + 'tab_grid_filters_normal', | |
| 6142 | + [ | |
| 6143 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 6144 | + ] | |
| 6145 | + ); | |
| 6146 | + | |
| 6147 | + $this->add_control( | |
| 6148 | + 'filters_color', | |
| 6149 | + [ | |
| 6150 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 6151 | + 'type' => Controls_Manager::COLOR, | |
| 6152 | + 'default' => '#7A7A7A', | |
| 6153 | + 'selectors' => [ | |
| 6154 | + '{{WRAPPER}} .king-addons-grid-filters li' => 'color: {{VALUE}}', | |
| 6155 | + '{{WRAPPER}} .king-addons-grid-filters li a' => 'color: {{VALUE}}', | |
| 6156 | + ], | |
| 6157 | + ] | |
| 6158 | + ); | |
| 6159 | + | |
| 6160 | + $this->add_control( | |
| 6161 | + 'filters_bg_color', | |
| 6162 | + [ | |
| 6163 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 6164 | + 'type' => Controls_Manager::COLOR, | |
| 6165 | + 'selectors' => [ | |
| 6166 | + '{{WRAPPER}} .king-addons-grid-filters li > a' => 'background-color: {{VALUE}}', | |
| 6167 | + '{{WRAPPER}} .king-addons-grid-filters li > span' => 'background-color: {{VALUE}}', | |
| 6168 | + ] | |
| 6169 | + ] | |
| 6170 | + ); | |
| 6171 | + | |
| 6172 | + $this->add_control( | |
| 6173 | + 'filters_border_color', | |
| 6174 | + [ | |
| 6175 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 6176 | + 'type' => Controls_Manager::COLOR, | |
| 6177 | + 'default' => '#E8E8E8', | |
| 6178 | + 'selectors' => [ | |
| 6179 | + '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-color: {{VALUE}}', | |
| 6180 | + '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-color: {{VALUE}}', | |
| 6181 | + ], | |
| 6182 | + ] | |
| 6183 | + ); | |
| 6184 | + | |
| 6185 | + $this->add_group_control( | |
| 6186 | + Group_Control_Box_Shadow::get_type(), | |
| 6187 | + [ | |
| 6188 | + 'name' => 'filters_box_shadow', | |
| 6189 | + 'selector' => '{{WRAPPER}} .king-addons-grid-filters li > a, {{WRAPPER}} .king-addons-grid-filters li > span', | |
| 6190 | + ] | |
| 6191 | + ); | |
| 6192 | + | |
| 6193 | + $this->add_control( | |
| 6194 | + 'filters_wrapper_color', | |
| 6195 | + [ | |
| 6196 | + 'label' => esc_html__('Wrapper Color', 'king-addons'), | |
| 6197 | + 'type' => Controls_Manager::COLOR, | |
| 6198 | + 'selectors' => [ | |
| 6199 | + '{{WRAPPER}} .king-addons-grid-filters' => 'background-color: {{VALUE}}', | |
| 6200 | + ], | |
| 6201 | + 'separator' => 'after', | |
| 6202 | + ] | |
| 6203 | + ); | |
| 6204 | + | |
| 6205 | + $this->end_controls_tab(); | |
| 6206 | + | |
| 6207 | + $this->start_controls_tab( | |
| 6208 | + 'tab_grid_filters_hover', | |
| 6209 | + [ | |
| 6210 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 6211 | + ] | |
| 6212 | + ); | |
| 6213 | + | |
| 6214 | + $this->add_control( | |
| 6215 | + 'filters_color_hr', | |
| 6216 | + [ | |
| 6217 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 6218 | + 'type' => Controls_Manager::COLOR, | |
| 6219 | + 'default' => '#ffffff', | |
| 6220 | + 'selectors' => [ | |
| 6221 | + '{{WRAPPER}} .king-addons-grid-filters li > a:hover' => 'color: {{VALUE}}', | |
| 6222 | + '{{WRAPPER}} .king-addons-grid-filters li > span:hover' => 'color: {{VALUE}}', | |
| 6223 | + '{{WRAPPER}} .king-addons-grid-filters li > .king-addons-active-filter' => 'color: {{VALUE}}', | |
| 6224 | + ], | |
| 6225 | + ] | |
| 6226 | + ); | |
| 6227 | + | |
| 6228 | + $this->add_control( | |
| 6229 | + 'filters_bg_color_hr', | |
| 6230 | + [ | |
| 6231 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 6232 | + 'type' => Controls_Manager::COLOR, | |
| 6233 | + 'default' => '#5B03FF', | |
| 6234 | + 'selectors' => [ | |
| 6235 | + '{{WRAPPER}} .king-addons-grid-filters li > a:hover' => 'background-color: {{VALUE}}', | |
| 6236 | + '{{WRAPPER}} .king-addons-grid-filters li > span:hover' => 'background-color: {{VALUE}}', | |
| 6237 | + '{{WRAPPER}} .king-addons-grid-filters li > .king-addons-active-filter' => 'background-color: {{VALUE}}', | |
| 6238 | + ] | |
| 6239 | + ] | |
| 6240 | + ); | |
| 6241 | + | |
| 6242 | + $this->add_control( | |
| 6243 | + 'filters_border_color_hr', | |
| 6244 | + [ | |
| 6245 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 6246 | + 'type' => Controls_Manager::COLOR, | |
| 6247 | + 'default' => '#E8E8E8', | |
| 6248 | + 'selectors' => [ | |
| 6249 | + '{{WRAPPER}} .king-addons-grid-filters li > a:hover' => 'border-color: {{VALUE}}', | |
| 6250 | + '{{WRAPPER}} .king-addons-grid-filters li > span:hover' => 'border-color: {{VALUE}}', | |
| 6251 | + '{{WRAPPER}} .king-addons-grid-filters li > .king-addons-active-filter' => 'border-color: {{VALUE}}', | |
| 6252 | + ] | |
| 6253 | + ] | |
| 6254 | + ); | |
| 6255 | + | |
| 6256 | + $this->add_control_filters_pointer_color_hr(); | |
| 6257 | + | |
| 6258 | + $this->add_group_control( | |
| 6259 | + Group_Control_Box_Shadow::get_type(), | |
| 6260 | + [ | |
| 6261 | + 'name' => 'filters_box_shadow_hr', | |
| 6262 | + 'selector' => '{{WRAPPER}} .king-addons-grid-filters li > a:hover, {{WRAPPER}} .king-addons-grid-filters li > span:hover', | |
| 6263 | + 'separator' => 'after', | |
| 6264 | + ] | |
| 6265 | + ); | |
| 6266 | + | |
| 6267 | + $this->end_controls_tab(); | |
| 6268 | + | |
| 6269 | + $this->end_controls_tabs(); | |
| 6270 | + | |
| 6271 | + $this->add_control_filters_pointer(); | |
| 6272 | + | |
| 6273 | + $this->add_control_filters_pointer_height(); | |
| 6274 | + | |
| 6275 | + $this->add_control_filters_pointer_animation(); | |
| 6276 | + | |
| 6277 | + $this->add_control( | |
| 6278 | + 'filters_transition_duration', | |
| 6279 | + [ | |
| 6280 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 6281 | + 'type' => Controls_Manager::NUMBER, | |
| 6282 | + 'default' => 0.1, | |
| 6283 | + 'min' => 0, | |
| 6284 | + 'max' => 5, | |
| 6285 | + 'step' => 0.1, | |
| 6286 | + 'selectors' => [ | |
| 6287 | + '{{WRAPPER}} .king-addons-grid-filters li > a' => 'transition-duration: {{VALUE}}s', | |
| 6288 | + '{{WRAPPER}} .king-addons-grid-filters li > span' => 'transition-duration: {{VALUE}}s', | |
| 6289 | + '{{WRAPPER}} .king-addons-grid-filters .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s', | |
| 6290 | + '{{WRAPPER}} .king-addons-grid-filters .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s', | |
| 6291 | + ], | |
| 6292 | + 'separator' => 'after', | |
| 6293 | + ] | |
| 6294 | + ); | |
| 6295 | + | |
| 6296 | + $this->add_group_control( | |
| 6297 | + Group_Control_Typography::get_type(), | |
| 6298 | + [ | |
| 6299 | + 'name' => 'filters_typography', | |
| 6300 | + 'selector' => '{{WRAPPER}} .king-addons-grid-filters li' | |
| 6301 | + ] | |
| 6302 | + ); | |
| 6303 | + | |
| 6304 | + $this->add_control( | |
| 6305 | + 'filters_border_type', | |
| 6306 | + [ | |
| 6307 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 6308 | + 'type' => Controls_Manager::SELECT, | |
| 6309 | + 'options' => [ | |
| 6310 | + 'none' => esc_html__('None', 'king-addons'), | |
| 6311 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 6312 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 6313 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 6314 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 6315 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 6316 | + ], | |
| 6317 | + 'default' => 'none', | |
| 6318 | + 'selectors' => [ | |
| 6319 | + '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-style: {{VALUE}};', | |
| 6320 | + '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-style: {{VALUE}};', | |
| 6321 | + ], | |
| 6322 | + 'separator' => 'before', | |
| 6323 | + ] | |
| 6324 | + ); | |
| 6325 | + | |
| 6326 | + $this->add_control( | |
| 6327 | + 'filters_border_width', | |
| 6328 | + [ | |
| 6329 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 6330 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6331 | + 'size_units' => ['px'], | |
| 6332 | + 'default' => [ | |
| 6333 | + 'top' => 1, | |
| 6334 | + 'right' => 1, | |
| 6335 | + 'bottom' => 1, | |
| 6336 | + 'left' => 1, | |
| 6337 | + ], | |
| 6338 | + 'selectors' => [ | |
| 6339 | + '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6340 | + '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6341 | + ], | |
| 6342 | + 'condition' => [ | |
| 6343 | + 'filters_border_type!' => 'none', | |
| 6344 | + ], | |
| 6345 | + ] | |
| 6346 | + ); | |
| 6347 | + | |
| 6348 | + $this->add_responsive_control( | |
| 6349 | + 'filters_distance_from_grid', | |
| 6350 | + [ | |
| 6351 | + 'label' => esc_html__('Distance From Grid', 'king-addons'), | |
| 6352 | + 'type' => Controls_Manager::SLIDER, | |
| 6353 | + 'size_units' => ['px'], | |
| 6354 | + 'range' => [ | |
| 6355 | + 'px' => [ | |
| 6356 | + 'min' => 0, | |
| 6357 | + 'max' => 100, | |
| 6358 | + ], | |
| 6359 | + ], | |
| 6360 | + 'default' => [ | |
| 6361 | + 'unit' => 'px', | |
| 6362 | + 'size' => 25, | |
| 6363 | + ], | |
| 6364 | + 'selectors' => [ | |
| 6365 | + '{{WRAPPER}} .king-addons-grid-filters' => 'margin-bottom: {{SIZE}}{{UNIT}};', | |
| 6366 | + ], | |
| 6367 | + 'separator' => 'before' | |
| 6368 | + ] | |
| 6369 | + ); | |
| 6370 | + | |
| 6371 | + $this->add_control( | |
| 6372 | + 'filters_icon_spacing', | |
| 6373 | + [ | |
| 6374 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 6375 | + 'type' => Controls_Manager::SLIDER, | |
| 6376 | + 'size_units' => ['px'], | |
| 6377 | + 'range' => [ | |
| 6378 | + 'px' => [ | |
| 6379 | + 'min' => 0, | |
| 6380 | + 'max' => 25, | |
| 6381 | + ], | |
| 6382 | + ], | |
| 6383 | + 'default' => [ | |
| 6384 | + 'unit' => 'px', | |
| 6385 | + 'size' => 0, | |
| 6386 | + ], | |
| 6387 | + 'selectors' => [ | |
| 6388 | + '{{WRAPPER}} .king-addons-grid-filters-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 6389 | + '{{WRAPPER}} .king-addons-grid-filters-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 6390 | + ], | |
| 6391 | + ] | |
| 6392 | + ); | |
| 6393 | + | |
| 6394 | + $this->add_responsive_control( | |
| 6395 | + 'filters_margin', | |
| 6396 | + [ | |
| 6397 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 6398 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6399 | + 'size_units' => ['px'], | |
| 6400 | + 'default' => [ | |
| 6401 | + 'top' => 0, | |
| 6402 | + 'right' => 5, | |
| 6403 | + 'bottom' => 0, | |
| 6404 | + 'left' => 0, | |
| 6405 | + ], | |
| 6406 | + 'selectors' => [ | |
| 6407 | + '{{WRAPPER}} .king-addons-grid-filters li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6408 | + ], | |
| 6409 | + ] | |
| 6410 | + ); | |
| 6411 | + | |
| 6412 | + $this->add_responsive_control( | |
| 6413 | + 'filters_padding', | |
| 6414 | + [ | |
| 6415 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 6416 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6417 | + 'size_units' => ['px',], | |
| 6418 | + 'default' => [ | |
| 6419 | + 'top' => 3, | |
| 6420 | + 'right' => 15, | |
| 6421 | + 'bottom' => 3, | |
| 6422 | + 'left' => 15, | |
| 6423 | + ], | |
| 6424 | + 'selectors' => [ | |
| 6425 | + '{{WRAPPER}} .king-addons-grid-filters li > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6426 | + '{{WRAPPER}} .king-addons-grid-filters li > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6427 | + ], | |
| 6428 | + ] | |
| 6429 | + ); | |
| 6430 | + | |
| 6431 | + $this->add_responsive_control( | |
| 6432 | + 'filters_wrapper_padding', | |
| 6433 | + [ | |
| 6434 | + 'label' => esc_html__('Wrapper Padding', 'king-addons'), | |
| 6435 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6436 | + 'size_units' => ['px',], | |
| 6437 | + 'default' => [ | |
| 6438 | + 'top' => 0, | |
| 6439 | + 'right' => 0, | |
| 6440 | + 'bottom' => 0, | |
| 6441 | + 'left' => 0, | |
| 6442 | + ], | |
| 6443 | + 'selectors' => [ | |
| 6444 | + '{{WRAPPER}} .king-addons-grid-filters' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6445 | + ], | |
| 6446 | + ] | |
| 6447 | + ); | |
| 6448 | + | |
| 6449 | + $this->add_control( | |
| 6450 | + 'filters_radius', | |
| 6451 | + [ | |
| 6452 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 6453 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6454 | + 'size_units' => ['px', '%'], | |
| 6455 | + 'default' => [ | |
| 6456 | + 'top' => 3, | |
| 6457 | + 'right' => 3, | |
| 6458 | + 'bottom' => 3, | |
| 6459 | + 'left' => 3, | |
| 6460 | + ], | |
| 6461 | + 'selectors' => [ | |
| 6462 | + '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6463 | + '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6464 | + ], | |
| 6465 | + 'separator' => 'before', | |
| 6466 | + ] | |
| 6467 | + ); | |
| 6468 | + | |
| 6469 | + $this->end_controls_section(); | |
| 6470 | + | |
| 6471 | + | |
| 6472 | + $this->start_controls_section( | |
| 6473 | + 'section_style_pagination', | |
| 6474 | + [ | |
| 6475 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Pagination', 'king-addons'), | |
| 6476 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 6477 | + 'show_label' => false, | |
| 6478 | + 'condition' => [ | |
| 6479 | + 'layout_select!' => 'slider', | |
| 6480 | + ], | |
| 6481 | + ] | |
| 6482 | + ); | |
| 6483 | + | |
| 6484 | + $this->start_controls_tabs('tabs_grid_pagination_style'); | |
| 6485 | + | |
| 6486 | + $this->start_controls_tab( | |
| 6487 | + 'tab_grid_pagination_normal', | |
| 6488 | + [ | |
| 6489 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 6490 | + ] | |
| 6491 | + ); | |
| 6492 | + | |
| 6493 | + $this->add_control( | |
| 6494 | + 'pagination_color', | |
| 6495 | + [ | |
| 6496 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 6497 | + 'type' => Controls_Manager::COLOR, | |
| 6498 | + 'default' => '#ffffff', | |
| 6499 | + 'selectors' => [ | |
| 6500 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'color: {{VALUE}}', | |
| 6501 | + '{{WRAPPER}} .king-addons-grid-pagination svg' => 'fill: {{VALUE}}', | |
| 6502 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'color: {{VALUE}}', | |
| 6503 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'color: {{VALUE}}', | |
| 6504 | + ], | |
| 6505 | + ] | |
| 6506 | + ); | |
| 6507 | + | |
| 6508 | + $this->add_control( | |
| 6509 | + 'pagination_bg_color', | |
| 6510 | + [ | |
| 6511 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 6512 | + 'type' => Controls_Manager::COLOR, | |
| 6513 | + 'default' => '#5B03FF', | |
| 6514 | + 'selectors' => [ | |
| 6515 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'background-color: {{VALUE}}', | |
| 6516 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'background-color: {{VALUE}}', | |
| 6517 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'background-color: {{VALUE}}', | |
| 6518 | + '{{WRAPPER}} .king-addons-pagination-finish' => 'color: {{VALUE}}', | |
| 6519 | + ] | |
| 6520 | + ] | |
| 6521 | + ); | |
| 6522 | + | |
| 6523 | + $this->add_control( | |
| 6524 | + 'pagination_border_color', | |
| 6525 | + [ | |
| 6526 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 6527 | + 'type' => Controls_Manager::COLOR, | |
| 6528 | + 'default' => '#E8E8E8', | |
| 6529 | + 'selectors' => [ | |
| 6530 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-color: {{VALUE}}', | |
| 6531 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-color: {{VALUE}}', | |
| 6532 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'border-color: {{VALUE}}', | |
| 6533 | + ], | |
| 6534 | + ] | |
| 6535 | + ); | |
| 6536 | + | |
| 6537 | + $this->add_group_control( | |
| 6538 | + Group_Control_Box_Shadow::get_type(), | |
| 6539 | + [ | |
| 6540 | + 'name' => 'pagination_box_shadow', | |
| 6541 | + 'selector' => '{{WRAPPER}} .king-addons-grid-pagination a, {{WRAPPER}} .king-addons-grid-pagination > div > span', | |
| 6542 | + ] | |
| 6543 | + ); | |
| 6544 | + | |
| 6545 | + $this->add_control( | |
| 6546 | + 'pagination_loader_color', | |
| 6547 | + [ | |
| 6548 | + 'label' => esc_html__('Loader Color', 'king-addons'), | |
| 6549 | + 'type' => Controls_Manager::COLOR, | |
| 6550 | + 'default' => '#5B03FF', | |
| 6551 | + 'selectors' => [ | |
| 6552 | + '{{WRAPPER}} .king-addons-double-bounce .king-addons-child' => 'background-color: {{VALUE}}', | |
| 6553 | + '{{WRAPPER}} .king-addons-wave .king-addons-rect' => 'background-color: {{VALUE}}', | |
| 6554 | + '{{WRAPPER}} .king-addons-spinner-pulse' => 'background-color: {{VALUE}}', | |
| 6555 | + '{{WRAPPER}} .king-addons-chasing-dots .king-addons-child' => 'background-color: {{VALUE}}', | |
| 6556 | + '{{WRAPPER}} .king-addons-three-bounce .king-addons-child' => 'background-color: {{VALUE}}', | |
| 6557 | + '{{WRAPPER}} .king-addons-fading-circle .king-addons-circle:before' => 'background-color: {{VALUE}}', | |
| 6558 | + '{{WRAPPER}} .king-addons-ring div' => 'border-color: {{VALUE}} transparent transparent transparent', | |
| 6559 | + ], | |
| 6560 | + 'condition' => [ | |
| 6561 | + 'pagination_type' => ['load-more', 'infinite-scroll'] | |
| 6562 | + ] | |
| 6563 | + ] | |
| 6564 | + ); | |
| 6565 | + | |
| 6566 | + $this->add_control( | |
| 6567 | + 'pagination_wrapper_color', | |
| 6568 | + [ | |
| 6569 | + 'label' => esc_html__('Wrapper Color', 'king-addons'), | |
| 6570 | + 'type' => Controls_Manager::COLOR, | |
| 6571 | + 'selectors' => [ | |
| 6572 | + '{{WRAPPER}} .king-addons-grid-pagination' => 'background-color: {{VALUE}}', | |
| 6573 | + ], | |
| 6574 | + 'separator' => 'after', | |
| 6575 | + ] | |
| 6576 | + ); | |
| 6577 | + | |
| 6578 | + $this->end_controls_tab(); | |
| 6579 | + | |
| 6580 | + $this->start_controls_tab( | |
| 6581 | + 'tab_grid_pagination_hover', | |
| 6582 | + [ | |
| 6583 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 6584 | + ] | |
| 6585 | + ); | |
| 6586 | + | |
| 6587 | + $this->add_control( | |
| 6588 | + 'pagination_color_hr', | |
| 6589 | + [ | |
| 6590 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 6591 | + 'type' => Controls_Manager::COLOR, | |
| 6592 | + 'default' => '#ffffff', | |
| 6593 | + 'selectors' => [ | |
| 6594 | + '{{WRAPPER}} .king-addons-grid-pagination a:hover' => 'color: {{VALUE}}', | |
| 6595 | + '{{WRAPPER}} .king-addons-grid-pagination a:hover svg' => 'fill: {{VALUE}}', | |
| 6596 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover' => 'color: {{VALUE}}', | |
| 6597 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'color: {{VALUE}}', | |
| 6598 | + ], | |
| 6599 | + ] | |
| 6600 | + ); | |
| 6601 | + | |
| 6602 | + $this->add_control( | |
| 6603 | + 'pagination_bg_color_hr', | |
| 6604 | + [ | |
| 6605 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 6606 | + 'type' => Controls_Manager::COLOR, | |
| 6607 | + 'default' => '#4D02D8', | |
| 6608 | + 'selectors' => [ | |
| 6609 | + '{{WRAPPER}} .king-addons-grid-pagination a:hover' => 'background-color: {{VALUE}}', | |
| 6610 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover' => 'background-color: {{VALUE}}', | |
| 6611 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'background-color: {{VALUE}}', | |
| 6612 | + ] | |
| 6613 | + ] | |
| 6614 | + ); | |
| 6615 | + | |
| 6616 | + $this->add_control( | |
| 6617 | + 'pagination_border_color_hr', | |
| 6618 | + [ | |
| 6619 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 6620 | + 'type' => Controls_Manager::COLOR, | |
| 6621 | + 'default' => '#E8E8E8', | |
| 6622 | + 'selectors' => [ | |
| 6623 | + '{{WRAPPER}} .king-addons-grid-pagination a:hover' => 'border-color: {{VALUE}}', | |
| 6624 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover' => 'border-color: {{VALUE}}', | |
| 6625 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-color: {{VALUE}}', | |
| 6626 | + ] | |
| 6627 | + ] | |
| 6628 | + ); | |
| 6629 | + | |
| 6630 | + $this->add_group_control( | |
| 6631 | + Group_Control_Box_Shadow::get_type(), | |
| 6632 | + [ | |
| 6633 | + 'name' => 'pagination_box_shadow_hr', | |
| 6634 | + 'selector' => '{{WRAPPER}} .king-addons-grid-pagination a:hover, {{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover', | |
| 6635 | + 'separator' => 'after', | |
| 6636 | + ] | |
| 6637 | + ); | |
| 6638 | + | |
| 6639 | + $this->end_controls_tab(); | |
| 6640 | + | |
| 6641 | + $this->end_controls_tabs(); | |
| 6642 | + | |
| 6643 | + $this->add_control( | |
| 6644 | + 'pagination_transition_duration', | |
| 6645 | + [ | |
| 6646 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 6647 | + 'type' => Controls_Manager::NUMBER, | |
| 6648 | + 'default' => 0.1, | |
| 6649 | + 'min' => 0, | |
| 6650 | + 'max' => 5, | |
| 6651 | + 'step' => 0.1, | |
| 6652 | + 'selectors' => [ | |
| 6653 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'transition-duration: {{VALUE}}s', | |
| 6654 | + '{{WRAPPER}} .king-addons-grid-pagination svg' => 'transition-duration: {{VALUE}}s', | |
| 6655 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'transition-duration: {{VALUE}}s', | |
| 6656 | + ], | |
| 6657 | + 'separator' => 'after', | |
| 6658 | + ] | |
| 6659 | + ); | |
| 6660 | + | |
| 6661 | + $this->add_group_control( | |
| 6662 | + Group_Control_Typography::get_type(), | |
| 6663 | + [ | |
| 6664 | + 'name' => 'pagination_typography', | |
| 6665 | + 'selector' => '{{WRAPPER}} .king-addons-grid-pagination, {{WRAPPER}} .king-addons-grid-pagination a' | |
| 6666 | + ] | |
| 6667 | + ); | |
| 6668 | + | |
| 6669 | + $this->add_responsive_control( | |
| 6670 | + 'pagination_icon_size', | |
| 6671 | + [ | |
| 6672 | + 'label' => esc_html__('Icon Size', 'king-addons'), | |
| 6673 | + 'type' => Controls_Manager::SLIDER, | |
| 6674 | + 'size_units' => ['px'], | |
| 6675 | + 'range' => [ | |
| 6676 | + 'px' => [ | |
| 6677 | + 'min' => 5, | |
| 6678 | + 'max' => 30, | |
| 6679 | + ], | |
| 6680 | + ], | |
| 6681 | + 'default' => [ | |
| 6682 | + 'unit' => 'px', | |
| 6683 | + 'size' => 15, | |
| 6684 | + ], | |
| 6685 | + 'selectors' => [ | |
| 6686 | + '{{WRAPPER}} .king-addons-grid-pagination i' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 6687 | + '{{WRAPPER}} .king-addons-grid-pagination svg' => 'width: {{SIZE}}{{UNIT}};', | |
| 6688 | + ], | |
| 6689 | + ] | |
| 6690 | + ); | |
| 6691 | + | |
| 6692 | + $this->add_control( | |
| 6693 | + 'pagination_border_type', | |
| 6694 | + [ | |
| 6695 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 6696 | + 'type' => Controls_Manager::SELECT, | |
| 6697 | + 'options' => [ | |
| 6698 | + 'none' => esc_html__('None', 'king-addons'), | |
| 6699 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 6700 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 6701 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 6702 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 6703 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 6704 | + ], | |
| 6705 | + 'default' => 'none', | |
| 6706 | + 'selectors' => [ | |
| 6707 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-style: {{VALUE}};', | |
| 6708 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-style: {{VALUE}};', | |
| 6709 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-style: {{VALUE}};', | |
| 6710 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'border-style: {{VALUE}}', | |
| 6711 | + ], | |
| 6712 | + 'separator' => 'before', | |
| 6713 | + ] | |
| 6714 | + ); | |
| 6715 | + | |
| 6716 | + $this->add_control( | |
| 6717 | + 'pagination_border_width', | |
| 6718 | + [ | |
| 6719 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 6720 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6721 | + 'size_units' => ['px'], | |
| 6722 | + 'default' => [ | |
| 6723 | + 'top' => 1, | |
| 6724 | + 'right' => 1, | |
| 6725 | + 'bottom' => 1, | |
| 6726 | + 'left' => 1, | |
| 6727 | + ], | |
| 6728 | + 'selectors' => [ | |
| 6729 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6730 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6731 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6732 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6733 | + ], | |
| 6734 | + 'condition' => [ | |
| 6735 | + 'pagination_border_type!' => 'none', | |
| 6736 | + ], | |
| 6737 | + ] | |
| 6738 | + ); | |
| 6739 | + | |
| 6740 | + $this->add_responsive_control( | |
| 6741 | + 'pagination_distance_from_grid', | |
| 6742 | + [ | |
| 6743 | + 'label' => esc_html__('Distance From Grid', 'king-addons'), | |
| 6744 | + 'type' => Controls_Manager::SLIDER, | |
| 6745 | + 'size_units' => ['px'], | |
| 6746 | + 'range' => [ | |
| 6747 | + 'px' => [ | |
| 6748 | + 'min' => 0, | |
| 6749 | + 'max' => 100, | |
| 6750 | + ], | |
| 6751 | + ], | |
| 6752 | + 'default' => [ | |
| 6753 | + 'unit' => 'px', | |
| 6754 | + 'size' => 25, | |
| 6755 | + ], | |
| 6756 | + 'selectors' => [ | |
| 6757 | + '{{WRAPPER}} .king-addons-grid-pagination' => 'margin-top: {{SIZE}}{{UNIT}};', | |
| 6758 | + ], | |
| 6759 | + 'separator' => 'before' | |
| 6760 | + ] | |
| 6761 | + ); | |
| 6762 | + | |
| 6763 | + $this->add_control( | |
| 6764 | + 'pagination_gutter', | |
| 6765 | + [ | |
| 6766 | + 'label' => esc_html__('Gutter', 'king-addons'), | |
| 6767 | + 'type' => Controls_Manager::SLIDER, | |
| 6768 | + 'size_units' => ['px'], | |
| 6769 | + 'range' => [ | |
| 6770 | + 'px' => [ | |
| 6771 | + 'min' => 0, | |
| 6772 | + 'max' => 25, | |
| 6773 | + ], | |
| 6774 | + ], | |
| 6775 | + 'default' => [ | |
| 6776 | + 'unit' => 'px', | |
| 6777 | + 'size' => 10, | |
| 6778 | + ], | |
| 6779 | + 'selectors' => [ | |
| 6780 | + | |
| 6781 | + '{{WRAPPER}} .king-addons-grid-pagination a:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6782 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6783 | + '{{WRAPPER}} .king-addons-grid-pagination > div > a.king-addons-prev-page' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6784 | + | |
| 6785 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6786 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6787 | + ], | |
| 6788 | + ] | |
| 6789 | + ); | |
| 6790 | + | |
| 6791 | + $this->add_control( | |
| 6792 | + 'pagination_icon_spacing', | |
| 6793 | + [ | |
| 6794 | + 'label' => esc_html__('Icon Spacing', 'king-addons'), | |
| 6795 | + 'type' => Controls_Manager::SLIDER, | |
| 6796 | + 'size_units' => ['px'], | |
| 6797 | + 'range' => [ | |
| 6798 | + 'px' => [ | |
| 6799 | + 'min' => 0, | |
| 6800 | + 'max' => 25, | |
| 6801 | + ], | |
| 6802 | + ], | |
| 6803 | + 'default' => [ | |
| 6804 | + 'unit' => 'px', | |
| 6805 | + 'size' => 10, | |
| 6806 | + ], | |
| 6807 | + 'selectors' => [ | |
| 6808 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-post-link i' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 6809 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-post-link i' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 6810 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-first-page i' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 6811 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-page i' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 6812 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-page i' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 6813 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-last-page i' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 6814 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-post-link svg' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6815 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-post-link svg' => 'margin-left: {{SIZE}}{{UNIT}};', | |
| 6816 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-first-page svg' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6817 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-page svg' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 6818 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-page svg' => 'margin-left: {{SIZE}}{{UNIT}};', | |
| 6819 | + '{{WRAPPER}} .king-addons-grid-pagination .king-addons-last-page svg' => 'margin-left: {{SIZE}}{{UNIT}};', | |
| 6820 | + ], | |
| 6821 | + ] | |
| 6822 | + ); | |
| 6823 | + | |
| 6824 | + $this->add_responsive_control( | |
| 6825 | + 'pagination_padding', | |
| 6826 | + [ | |
| 6827 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 6828 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6829 | + 'size_units' => ['px'], | |
| 6830 | + 'default' => [ | |
| 6831 | + 'top' => 8, | |
| 6832 | + 'right' => 20, | |
| 6833 | + 'bottom' => 8, | |
| 6834 | + 'left' => 20, | |
| 6835 | + ], | |
| 6836 | + 'selectors' => [ | |
| 6837 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6838 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6839 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6840 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6841 | + ], | |
| 6842 | + ] | |
| 6843 | + ); | |
| 6844 | + | |
| 6845 | + $this->add_responsive_control( | |
| 6846 | + 'pagination_wrapper_padding', | |
| 6847 | + [ | |
| 6848 | + 'label' => esc_html__('Wrapper Padding', 'king-addons'), | |
| 6849 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6850 | + 'size_units' => ['px'], | |
| 6851 | + 'default' => [ | |
| 6852 | + 'top' => 0, | |
| 6853 | + 'right' => 0, | |
| 6854 | + 'bottom' => 0, | |
| 6855 | + 'left' => 0, | |
| 6856 | + ], | |
| 6857 | + 'selectors' => [ | |
| 6858 | + '{{WRAPPER}} .king-addons-grid-pagination' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6859 | + ], | |
| 6860 | + ] | |
| 6861 | + ); | |
| 6862 | + | |
| 6863 | + $this->add_control( | |
| 6864 | + 'pagination_radius', | |
| 6865 | + [ | |
| 6866 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 6867 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 6868 | + 'size_units' => ['px', '%'], | |
| 6869 | + 'default' => [ | |
| 6870 | + 'top' => 3, | |
| 6871 | + 'right' => 3, | |
| 6872 | + 'bottom' => 3, | |
| 6873 | + 'left' => 3, | |
| 6874 | + ], | |
| 6875 | + 'selectors' => [ | |
| 6876 | + '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6877 | + '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6878 | + '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 6879 | + ], | |
| 6880 | + 'separator' => 'before', | |
| 6881 | + ] | |
| 6882 | + ); | |
| 6883 | + | |
| 6884 | + $this->end_controls_section(); | |
| 6885 | + | |
| 6886 | + | |
| 6887 | + $this->start_controls_section( | |
| 6888 | + 'section_style_pwd_protected', | |
| 6889 | + [ | |
| 6890 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Password Protected', 'king-addons'), | |
| 6891 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 6892 | + 'show_label' => false, | |
| 6893 | + ] | |
| 6894 | + ); | |
| 6895 | + | |
| 6896 | + $this->add_control( | |
| 6897 | + 'pwd_protected_color', | |
| 6898 | + [ | |
| 6899 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 6900 | + 'type' => Controls_Manager::COLOR, | |
| 6901 | + 'default' => '#ffffff', | |
| 6902 | + 'selectors' => [ | |
| 6903 | + '{{WRAPPER}} .king-addons-grid-item-protected' => 'color: {{VALUE}}', | |
| 6904 | + ], | |
| 6905 | + ] | |
| 6906 | + ); | |
| 6907 | + | |
| 6908 | + $this->add_control( | |
| 6909 | + 'pwd_protected_bg_color', | |
| 6910 | + [ | |
| 6911 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 6912 | + 'type' => Controls_Manager::COLOR, | |
| 6913 | + 'default' => '#5B03FF', | |
| 6914 | + 'selectors' => [ | |
| 6915 | + '{{WRAPPER}} .king-addons-grid-item-protected' => 'background-color: {{VALUE}}', | |
| 6916 | + ] | |
| 6917 | + ] | |
| 6918 | + ); | |
| 6919 | + | |
| 6920 | + $this->add_control( | |
| 6921 | + 'pwd_protected_input_color', | |
| 6922 | + [ | |
| 6923 | + 'label' => esc_html__('Input Background Color', 'king-addons'), | |
| 6924 | + 'type' => Controls_Manager::COLOR, | |
| 6925 | + 'default' => '#ffffff', | |
| 6926 | + 'selectors' => [ | |
| 6927 | + '{{WRAPPER}} .king-addons-grid-item-protected input' => 'background-color: {{VALUE}}', | |
| 6928 | + ] | |
| 6929 | + ] | |
| 6930 | + ); | |
| 6931 | + | |
| 6932 | + $this->add_group_control( | |
| 6933 | + Group_Control_Typography::get_type(), | |
| 6934 | + [ | |
| 6935 | + 'name' => 'pwd_protected_typography', | |
| 6936 | + 'selector' => '{{WRAPPER}} .king-addons-grid-item-protected p' | |
| 6937 | + ] | |
| 6938 | + ); | |
| 6939 | + | |
| 6940 | + $this->end_controls_section(); | |
| 6941 | + | |
| 6942 | + | |
| 6943 | + $this->start_controls_section( | |
| 6944 | + 'section_style_separator1', | |
| 6945 | + [ | |
| 6946 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 1', 'king-addons'), | |
| 6947 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 6948 | + 'show_label' => false, | |
| 6949 | + ] | |
| 6950 | + ); | |
| 6951 | + | |
| 6952 | + $this->add_control( | |
| 6953 | + 'separator1_color', | |
| 6954 | + [ | |
| 6955 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 6956 | + 'type' => Controls_Manager::COLOR, | |
| 6957 | + 'default' => '#E8E8E8', | |
| 6958 | + 'selectors' => [ | |
| 6959 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-color: {{VALUE}}', | |
| 6960 | + ], | |
| 6961 | + ] | |
| 6962 | + ); | |
| 6963 | + | |
| 6964 | + $this->add_control( | |
| 6965 | + 'separator1_width', | |
| 6966 | + [ | |
| 6967 | + 'label' => esc_html__('Width', 'king-addons'), | |
| 6968 | + 'type' => Controls_Manager::SLIDER, | |
| 6969 | + 'size_units' => ['px', '%'], | |
| 6970 | + 'range' => [ | |
| 6971 | + 'px' => [ | |
| 6972 | + 'min' => 0, | |
| 6973 | + 'max' => 300, | |
| 6974 | + ], | |
| 6975 | + '%' => [ | |
| 6976 | + 'min' => 0, | |
| 6977 | + 'max' => 100, | |
| 6978 | + ], | |
| 6979 | + ], | |
| 6980 | + 'default' => [ | |
| 6981 | + 'unit' => '%', | |
| 6982 | + 'size' => 100, | |
| 6983 | + ], | |
| 6984 | + 'selectors' => [ | |
| 6985 | + '{{WRAPPER}} .king-addons-grid-sep-style-1:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};', | |
| 6986 | + '{{WRAPPER}} .king-addons-grid-sep-style-1.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};', | |
| 6987 | + ], | |
| 6988 | + 'render_type' => 'template', | |
| 6989 | + 'separator' => 'before', | |
| 6990 | + ] | |
| 6991 | + ); | |
| 6992 | + | |
| 6993 | + $this->add_control( | |
| 6994 | + 'separator1_height', | |
| 6995 | + [ | |
| 6996 | + 'label' => esc_html__('Height', 'king-addons'), | |
| 6997 | + 'type' => Controls_Manager::SLIDER, | |
| 6998 | + 'size_units' => ['px'], | |
| 6999 | + 'range' => [ | |
| 7000 | + 'px' => [ | |
| 7001 | + 'min' => 1, | |
| 7002 | + 'max' => 100, | |
| 7003 | + ], | |
| 7004 | + ], | |
| 7005 | + 'default' => [ | |
| 7006 | + 'unit' => 'px', | |
| 7007 | + 'size' => 2, | |
| 7008 | + ], | |
| 7009 | + 'render_type' => 'template', | |
| 7010 | + 'selectors' => [ | |
| 7011 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};', | |
| 7012 | + ], | |
| 7013 | + ] | |
| 7014 | + ); | |
| 7015 | + | |
| 7016 | + $this->add_control( | |
| 7017 | + 'separator1_border_type', | |
| 7018 | + [ | |
| 7019 | + 'label' => esc_html__('Type', 'king-addons'), | |
| 7020 | + 'type' => Controls_Manager::SELECT, | |
| 7021 | + 'options' => [ | |
| 7022 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 7023 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 7024 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 7025 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 7026 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 7027 | + ], | |
| 7028 | + 'default' => 'solid', | |
| 7029 | + 'selectors' => [ | |
| 7030 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-style: {{VALUE}};', | |
| 7031 | + ], | |
| 7032 | + 'separator' => 'before', | |
| 7033 | + ] | |
| 7034 | + ); | |
| 7035 | + | |
| 7036 | + $this->add_responsive_control( | |
| 7037 | + 'separator1_margin', | |
| 7038 | + [ | |
| 7039 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 7040 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7041 | + 'size_units' => ['px', '%'], | |
| 7042 | + 'default' => [ | |
| 7043 | + 'top' => 15, | |
| 7044 | + 'right' => 0, | |
| 7045 | + 'bottom' => 15, | |
| 7046 | + 'left' => 0, | |
| 7047 | + ], | |
| 7048 | + 'render_type' => 'template', | |
| 7049 | + 'selectors' => [ | |
| 7050 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7051 | + ], | |
| 7052 | + ] | |
| 7053 | + ); | |
| 7054 | + | |
| 7055 | + $this->add_control( | |
| 7056 | + 'separator1_radius', | |
| 7057 | + [ | |
| 7058 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 7059 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7060 | + 'size_units' => ['px', '%'], | |
| 7061 | + 'default' => [ | |
| 7062 | + 'top' => 0, | |
| 7063 | + 'right' => 0, | |
| 7064 | + 'bottom' => 0, | |
| 7065 | + 'left' => 0, | |
| 7066 | + ], | |
| 7067 | + 'selectors' => [ | |
| 7068 | + '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7069 | + ], | |
| 7070 | + 'separator' => 'before', | |
| 7071 | + ] | |
| 7072 | + ); | |
| 7073 | + | |
| 7074 | + $this->end_controls_section(); | |
| 7075 | + | |
| 7076 | + | |
| 7077 | + $this->start_controls_section( | |
| 7078 | + 'section_style_separator2', | |
| 7079 | + [ | |
| 7080 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 2', 'king-addons'), | |
| 7081 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 7082 | + 'show_label' => false, | |
| 7083 | + ] | |
| 7084 | + ); | |
| 7085 | + | |
| 7086 | + $this->add_control( | |
| 7087 | + 'separator2_color', | |
| 7088 | + [ | |
| 7089 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 7090 | + 'type' => Controls_Manager::COLOR, | |
| 7091 | + 'default' => '#5B03FF', | |
| 7092 | + 'selectors' => [ | |
| 7093 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-color: {{VALUE}}', | |
| 7094 | + ], | |
| 7095 | + ] | |
| 7096 | + ); | |
| 7097 | + | |
| 7098 | + $this->add_control( | |
| 7099 | + 'separator2_width', | |
| 7100 | + [ | |
| 7101 | + 'label' => esc_html__('Width', 'king-addons'), | |
| 7102 | + 'type' => Controls_Manager::SLIDER, | |
| 7103 | + 'size_units' => ['px', '%'], | |
| 7104 | + 'range' => [ | |
| 7105 | + 'px' => [ | |
| 7106 | + 'min' => 0, | |
| 7107 | + 'max' => 300, | |
| 7108 | + ], | |
| 7109 | + '%' => [ | |
| 7110 | + 'min' => 0, | |
| 7111 | + 'max' => 100, | |
| 7112 | + ], | |
| 7113 | + ], | |
| 7114 | + 'default' => [ | |
| 7115 | + 'unit' => '%', | |
| 7116 | + 'size' => 20, | |
| 7117 | + ], | |
| 7118 | + 'selectors' => [ | |
| 7119 | + '{{WRAPPER}} .king-addons-grid-sep-style-2:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};', | |
| 7120 | + '{{WRAPPER}} .king-addons-grid-sep-style-2.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};', | |
| 7121 | + ], | |
| 7122 | + 'render_type' => 'template', | |
| 7123 | + 'separator' => 'before', | |
| 7124 | + ] | |
| 7125 | + ); | |
| 7126 | + | |
| 7127 | + $this->add_control( | |
| 7128 | + 'separator2_height', | |
| 7129 | + [ | |
| 7130 | + 'label' => esc_html__('Height', 'king-addons'), | |
| 7131 | + 'type' => Controls_Manager::SLIDER, | |
| 7132 | + 'size_units' => ['px'], | |
| 7133 | + 'range' => [ | |
| 7134 | + 'px' => [ | |
| 7135 | + 'min' => 0, | |
| 7136 | + 'max' => 100, | |
| 7137 | + ], | |
| 7138 | + ], | |
| 7139 | + 'default' => [ | |
| 7140 | + 'unit' => 'px', | |
| 7141 | + 'size' => 2, | |
| 7142 | + ], | |
| 7143 | + 'selectors' => [ | |
| 7144 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};', | |
| 7145 | + ], | |
| 7146 | + 'render_type' => 'template', | |
| 7147 | + ] | |
| 7148 | + ); | |
| 7149 | + | |
| 7150 | + $this->add_control( | |
| 7151 | + 'separator2_border_type', | |
| 7152 | + [ | |
| 7153 | + 'label' => esc_html__('Type', 'king-addons'), | |
| 7154 | + 'type' => Controls_Manager::SELECT, | |
| 7155 | + 'options' => [ | |
| 7156 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 7157 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 7158 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 7159 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 7160 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 7161 | + ], | |
| 7162 | + 'default' => 'solid', | |
| 7163 | + 'selectors' => [ | |
| 7164 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-style: {{VALUE}};', | |
| 7165 | + ], | |
| 7166 | + 'separator' => 'before', | |
| 7167 | + ] | |
| 7168 | + ); | |
| 7169 | + | |
| 7170 | + $this->add_responsive_control( | |
| 7171 | + 'separator2_margin', | |
| 7172 | + [ | |
| 7173 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 7174 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7175 | + 'size_units' => ['px', '%'], | |
| 7176 | + 'default' => [ | |
| 7177 | + 'top' => 15, | |
| 7178 | + 'right' => 0, | |
| 7179 | + 'bottom' => 15, | |
| 7180 | + 'left' => 0, | |
| 7181 | + ], | |
| 7182 | + 'selectors' => [ | |
| 7183 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7184 | + ], | |
| 7185 | + 'render_type' => 'template', | |
| 7186 | + ] | |
| 7187 | + ); | |
| 7188 | + | |
| 7189 | + $this->add_control( | |
| 7190 | + 'separator2_radius', | |
| 7191 | + [ | |
| 7192 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 7193 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7194 | + 'size_units' => ['px', '%'], | |
| 7195 | + 'default' => [ | |
| 7196 | + 'top' => 0, | |
| 7197 | + 'right' => 0, | |
| 7198 | + 'bottom' => 0, | |
| 7199 | + 'left' => 0, | |
| 7200 | + ], | |
| 7201 | + 'selectors' => [ | |
| 7202 | + '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7203 | + ], | |
| 7204 | + 'separator' => 'before', | |
| 7205 | + ] | |
| 7206 | + ); | |
| 7207 | + | |
| 7208 | + $this->end_controls_section(); | |
| 7209 | + | |
| 7210 | + | |
| 7211 | + $this->start_controls_section( | |
| 7212 | + 'section_style_tax1', | |
| 7213 | + [ | |
| 7214 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Taxonomy Style 1', 'king-addons'), | |
| 7215 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 7216 | + 'show_label' => false, | |
| 7217 | + ] | |
| 7218 | + ); | |
| 7219 | + | |
| 7220 | + $this->start_controls_tabs('tabs_grid_tax1_style'); | |
| 7221 | + | |
| 7222 | + $this->start_controls_tab( | |
| 7223 | + 'tab_grid_tax1_normal', | |
| 7224 | + [ | |
| 7225 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 7226 | + ] | |
| 7227 | + ); | |
| 7228 | + | |
| 7229 | + $this->add_control( | |
| 7230 | + 'tax1_color', | |
| 7231 | + [ | |
| 7232 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 7233 | + 'type' => Controls_Manager::COLOR, | |
| 7234 | + 'default' => '#9C9C9C', | |
| 7235 | + 'selectors' => [ | |
| 7236 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'color: {{VALUE}}', | |
| 7237 | + ], | |
| 7238 | + ] | |
| 7239 | + ); | |
| 7240 | + | |
| 7241 | + $this->add_control( | |
| 7242 | + 'tax1_bg_color', | |
| 7243 | + [ | |
| 7244 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 7245 | + 'type' => Controls_Manager::COLOR, | |
| 7246 | + 'selectors' => [ | |
| 7247 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'background-color: {{VALUE}}', | |
| 7248 | + ] | |
| 7249 | + ] | |
| 7250 | + ); | |
| 7251 | + | |
| 7252 | + $this->add_control( | |
| 7253 | + 'tax1_border_color', | |
| 7254 | + [ | |
| 7255 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 7256 | + 'type' => Controls_Manager::COLOR, | |
| 7257 | + 'default' => '#E8E8E8', | |
| 7258 | + 'selectors' => [ | |
| 7259 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-color: {{VALUE}}', | |
| 7260 | + ], | |
| 7261 | + ] | |
| 7262 | + ); | |
| 7263 | + | |
| 7264 | + $this->add_control( | |
| 7265 | + 'tax1_extra_text_color', | |
| 7266 | + [ | |
| 7267 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 7268 | + 'type' => Controls_Manager::COLOR, | |
| 7269 | + 'default' => '#9C9C9C', | |
| 7270 | + 'selectors' => [ | |
| 7271 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 7272 | + ], | |
| 7273 | + ] | |
| 7274 | + ); | |
| 7275 | + | |
| 7276 | + $this->add_control( | |
| 7277 | + 'tax1_extra_icon_color', | |
| 7278 | + [ | |
| 7279 | + 'label' => esc_html__('Extra Icon Color', 'king-addons'), | |
| 7280 | + 'type' => Controls_Manager::COLOR, | |
| 7281 | + 'default' => '#9C9C9C', | |
| 7282 | + 'selectors' => [ | |
| 7283 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}', | |
| 7284 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}' | |
| 7285 | + ], | |
| 7286 | + 'separator' => 'after', | |
| 7287 | + ] | |
| 7288 | + ); | |
| 7289 | + | |
| 7290 | + $this->add_control_tax1_custom_colors($tax_meta_keys[1]); | |
| 7291 | + | |
| 7292 | + $this->end_controls_tab(); | |
| 7293 | + | |
| 7294 | + $this->start_controls_tab( | |
| 7295 | + 'tab_grid_tax1_hover', | |
| 7296 | + [ | |
| 7297 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 7298 | + ] | |
| 7299 | + ); | |
| 7300 | + | |
| 7301 | + $this->add_control( | |
| 7302 | + 'tax1_color_hr', | |
| 7303 | + [ | |
| 7304 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 7305 | + 'type' => Controls_Manager::COLOR, | |
| 7306 | + 'default' => '#5B03FF', | |
| 7307 | + 'selectors' => [ | |
| 7308 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'color: {{VALUE}}', | |
| 7309 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:before' => 'background-color: {{VALUE}}', | |
| 7310 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:after' => 'background-color: {{VALUE}}', | |
| 7311 | + ], | |
| 7312 | + ] | |
| 7313 | + ); | |
| 7314 | + | |
| 7315 | + $this->add_control( | |
| 7316 | + 'tax1_bg_color_hr', | |
| 7317 | + [ | |
| 7318 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 7319 | + 'type' => Controls_Manager::COLOR, | |
| 7320 | + 'selectors' => [ | |
| 7321 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 7322 | + ] | |
| 7323 | + ] | |
| 7324 | + ); | |
| 7325 | + | |
| 7326 | + $this->add_control( | |
| 7327 | + 'tax1_border_color_hr', | |
| 7328 | + [ | |
| 7329 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 7330 | + 'type' => Controls_Manager::COLOR, | |
| 7331 | + 'default' => '#E8E8E8', | |
| 7332 | + 'selectors' => [ | |
| 7333 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 7334 | + ], | |
| 7335 | + ] | |
| 7336 | + ); | |
| 7337 | + | |
| 7338 | + $this->add_control_tax1_pointer_color_hr(); | |
| 7339 | + | |
| 7340 | + $this->end_controls_tab(); | |
| 7341 | + | |
| 7342 | + $this->end_controls_tabs(); | |
| 7343 | + | |
| 7344 | + $this->add_control_tax1_pointer(); | |
| 7345 | + | |
| 7346 | + $this->add_control_tax1_pointer_height(); | |
| 7347 | + | |
| 7348 | + $this->add_control_tax1_pointer_animation(); | |
| 7349 | + | |
| 7350 | + $this->add_control( | |
| 7351 | + 'tax1_transition_duration', | |
| 7352 | + [ | |
| 7353 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 7354 | + 'type' => Controls_Manager::NUMBER, | |
| 7355 | + 'default' => 0.1, | |
| 7356 | + 'min' => 0, | |
| 7357 | + 'max' => 5, | |
| 7358 | + 'step' => 0.1, | |
| 7359 | + 'selectors' => [ | |
| 7360 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 7361 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s', | |
| 7362 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s', | |
| 7363 | + ], | |
| 7364 | + 'separator' => 'after', | |
| 7365 | + ] | |
| 7366 | + ); | |
| 7367 | + | |
| 7368 | + $this->add_group_control( | |
| 7369 | + Group_Control_Typography::get_type(), | |
| 7370 | + [ | |
| 7371 | + 'name' => 'tax1_typography', | |
| 7372 | + 'selector' => '{{WRAPPER}} .king-addons-grid-tax-style-1' | |
| 7373 | + ] | |
| 7374 | + ); | |
| 7375 | + | |
| 7376 | + $this->add_control( | |
| 7377 | + 'tax1_border_type', | |
| 7378 | + [ | |
| 7379 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 7380 | + 'type' => Controls_Manager::SELECT, | |
| 7381 | + 'options' => [ | |
| 7382 | + 'none' => esc_html__('None', 'king-addons'), | |
| 7383 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 7384 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 7385 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 7386 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 7387 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 7388 | + ], | |
| 7389 | + 'default' => 'none', | |
| 7390 | + 'selectors' => [ | |
| 7391 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-style: {{VALUE}};', | |
| 7392 | + ], | |
| 7393 | + 'render_type' => 'template', | |
| 7394 | + 'separator' => 'before', | |
| 7395 | + ] | |
| 7396 | + ); | |
| 7397 | + | |
| 7398 | + $this->add_control( | |
| 7399 | + 'tax1_border_width', | |
| 7400 | + [ | |
| 7401 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 7402 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7403 | + 'size_units' => ['px'], | |
| 7404 | + 'default' => [ | |
| 7405 | + 'top' => 1, | |
| 7406 | + 'right' => 1, | |
| 7407 | + 'bottom' => 1, | |
| 7408 | + 'left' => 1, | |
| 7409 | + ], | |
| 7410 | + 'selectors' => [ | |
| 7411 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7412 | + ], | |
| 7413 | + 'render_type' => 'template', | |
| 7414 | + 'condition' => [ | |
| 7415 | + 'tax1_border_type!' => 'none', | |
| 7416 | + ], | |
| 7417 | + ] | |
| 7418 | + ); | |
| 7419 | + | |
| 7420 | + $this->add_control( | |
| 7421 | + 'tax1_text_spacing', | |
| 7422 | + [ | |
| 7423 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 7424 | + 'type' => Controls_Manager::SLIDER, | |
| 7425 | + 'size_units' => ['px'], | |
| 7426 | + 'range' => [ | |
| 7427 | + 'px' => [ | |
| 7428 | + 'min' => 0, | |
| 7429 | + 'max' => 25, | |
| 7430 | + ], | |
| 7431 | + ], | |
| 7432 | + 'default' => [ | |
| 7433 | + 'unit' => 'px', | |
| 7434 | + 'size' => 5, | |
| 7435 | + ], | |
| 7436 | + 'selectors' => [ | |
| 7437 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 7438 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 7439 | + ], | |
| 7440 | + 'render_type' => 'template', | |
| 7441 | + 'separator' => 'before', | |
| 7442 | + ] | |
| 7443 | + ); | |
| 7444 | + | |
| 7445 | + $this->add_control( | |
| 7446 | + 'tax1_icon_spacing', | |
| 7447 | + [ | |
| 7448 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 7449 | + 'type' => Controls_Manager::SLIDER, | |
| 7450 | + 'size_units' => ['px'], | |
| 7451 | + 'range' => [ | |
| 7452 | + 'px' => [ | |
| 7453 | + 'min' => 0, | |
| 7454 | + 'max' => 25, | |
| 7455 | + ], | |
| 7456 | + ], | |
| 7457 | + 'default' => [ | |
| 7458 | + 'unit' => 'px', | |
| 7459 | + 'size' => 5, | |
| 7460 | + ], | |
| 7461 | + 'selectors' => [ | |
| 7462 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 7463 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 7464 | + ], | |
| 7465 | + ] | |
| 7466 | + ); | |
| 7467 | + | |
| 7468 | + $this->add_control( | |
| 7469 | + 'tax1_gutter', | |
| 7470 | + [ | |
| 7471 | + 'label' => esc_html__('Gutter', 'king-addons'), | |
| 7472 | + 'type' => Controls_Manager::SLIDER, | |
| 7473 | + 'size_units' => ['px'], | |
| 7474 | + 'range' => [ | |
| 7475 | + 'px' => [ | |
| 7476 | + 'min' => 0, | |
| 7477 | + 'max' => 20, | |
| 7478 | + ], | |
| 7479 | + ], | |
| 7480 | + 'default' => [ | |
| 7481 | + 'unit' => 'px', | |
| 7482 | + 'size' => 3, | |
| 7483 | + ], | |
| 7484 | + 'selectors' => [ | |
| 7485 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 7486 | + ], | |
| 7487 | + 'render_type' => 'template', | |
| 7488 | + 'separator' => 'before', | |
| 7489 | + ] | |
| 7490 | + ); | |
| 7491 | + | |
| 7492 | + $this->add_responsive_control( | |
| 7493 | + 'tax1_padding', | |
| 7494 | + [ | |
| 7495 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 7496 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7497 | + 'size_units' => ['px', '%'], | |
| 7498 | + 'default' => [ | |
| 7499 | + 'top' => 0, | |
| 7500 | + 'right' => 0, | |
| 7501 | + 'bottom' => 0, | |
| 7502 | + 'left' => 0, | |
| 7503 | + ], | |
| 7504 | + 'selectors' => [ | |
| 7505 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7506 | + ], | |
| 7507 | + 'render_type' => 'template', | |
| 7508 | + ] | |
| 7509 | + ); | |
| 7510 | + | |
| 7511 | + $this->add_responsive_control( | |
| 7512 | + 'tax1_margin', | |
| 7513 | + [ | |
| 7514 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 7515 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7516 | + 'size_units' => ['px', '%'], | |
| 7517 | + 'default' => [ | |
| 7518 | + 'top' => 0, | |
| 7519 | + 'right' => 0, | |
| 7520 | + 'bottom' => 0, | |
| 7521 | + 'left' => 0, | |
| 7522 | + ], | |
| 7523 | + 'selectors' => [ | |
| 7524 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7525 | + ], | |
| 7526 | + 'render_type' => 'template', | |
| 7527 | + ] | |
| 7528 | + ); | |
| 7529 | + | |
| 7530 | + $this->add_control( | |
| 7531 | + 'tax1_radius', | |
| 7532 | + [ | |
| 7533 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 7534 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7535 | + 'size_units' => ['px', '%'], | |
| 7536 | + 'default' => [ | |
| 7537 | + 'top' => 0, | |
| 7538 | + 'right' => 0, | |
| 7539 | + 'bottom' => 0, | |
| 7540 | + 'left' => 0, | |
| 7541 | + ], | |
| 7542 | + 'selectors' => [ | |
| 7543 | + '{{WRAPPER}} .king-addons-grid-tax-style-1 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7544 | + ], | |
| 7545 | + 'separator' => 'before', | |
| 7546 | + ] | |
| 7547 | + ); | |
| 7548 | + | |
| 7549 | + $this->end_controls_section(); | |
| 7550 | + | |
| 7551 | + | |
| 7552 | + $this->start_controls_section( | |
| 7553 | + 'section_style_tax2', | |
| 7554 | + [ | |
| 7555 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Taxonomy Style 2', 'king-addons'), | |
| 7556 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 7557 | + 'show_label' => false, | |
| 7558 | + ] | |
| 7559 | + ); | |
| 7560 | + | |
| 7561 | + $this->start_controls_tabs('tabs_grid_tax2_style'); | |
| 7562 | + | |
| 7563 | + $this->start_controls_tab( | |
| 7564 | + 'tab_grid_tax2_normal', | |
| 7565 | + [ | |
| 7566 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 7567 | + ] | |
| 7568 | + ); | |
| 7569 | + | |
| 7570 | + $this->add_control( | |
| 7571 | + 'tax2_color', | |
| 7572 | + [ | |
| 7573 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 7574 | + 'type' => Controls_Manager::COLOR, | |
| 7575 | + 'default' => '#ffffff', | |
| 7576 | + 'selectors' => [ | |
| 7577 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'color: {{VALUE}}', | |
| 7578 | + ], | |
| 7579 | + ] | |
| 7580 | + ); | |
| 7581 | + | |
| 7582 | + $this->add_control( | |
| 7583 | + 'tax2_bg_color', | |
| 7584 | + [ | |
| 7585 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 7586 | + 'type' => Controls_Manager::COLOR, | |
| 7587 | + 'default' => '#5B03FF', | |
| 7588 | + 'selectors' => [ | |
| 7589 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'background-color: {{VALUE}}', | |
| 7590 | + ] | |
| 7591 | + ] | |
| 7592 | + ); | |
| 7593 | + | |
| 7594 | + $this->add_control( | |
| 7595 | + 'tax2_border_color', | |
| 7596 | + [ | |
| 7597 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 7598 | + 'type' => Controls_Manager::COLOR, | |
| 7599 | + 'default' => '#E8E8E8', | |
| 7600 | + 'selectors' => [ | |
| 7601 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-color: {{VALUE}}', | |
| 7602 | + ], | |
| 7603 | + ] | |
| 7604 | + ); | |
| 7605 | + | |
| 7606 | + $this->add_control( | |
| 7607 | + 'tax2_extra_text_color', | |
| 7608 | + [ | |
| 7609 | + 'label' => esc_html__('Extra Text Color', 'king-addons'), | |
| 7610 | + 'type' => Controls_Manager::COLOR, | |
| 7611 | + 'default' => '#9C9C9C', | |
| 7612 | + 'selectors' => [ | |
| 7613 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}', | |
| 7614 | + ], | |
| 7615 | + ] | |
| 7616 | + ); | |
| 7617 | + | |
| 7618 | + $this->add_control( | |
| 7619 | + 'tax2_extra_icon_color', | |
| 7620 | + [ | |
| 7621 | + 'label' => esc_html__('Extra Icon Color', 'king-addons'), | |
| 7622 | + 'type' => Controls_Manager::COLOR, | |
| 7623 | + 'default' => '#9C9C9C', | |
| 7624 | + 'selectors' => [ | |
| 7625 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}', | |
| 7626 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}' | |
| 7627 | + ], | |
| 7628 | + 'separator' => 'after', | |
| 7629 | + ] | |
| 7630 | + ); | |
| 7631 | + | |
| 7632 | + $this->end_controls_tab(); | |
| 7633 | + | |
| 7634 | + $this->start_controls_tab( | |
| 7635 | + 'tab_grid_tax2_hover', | |
| 7636 | + [ | |
| 7637 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 7638 | + ] | |
| 7639 | + ); | |
| 7640 | + | |
| 7641 | + $this->add_control( | |
| 7642 | + 'tax2_color_hr', | |
| 7643 | + [ | |
| 7644 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 7645 | + 'type' => Controls_Manager::COLOR, | |
| 7646 | + 'default' => '#ffffff', | |
| 7647 | + 'selectors' => [ | |
| 7648 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'color: {{VALUE}}', | |
| 7649 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:before' => 'background-color: {{VALUE}}', | |
| 7650 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:after' => 'background-color: {{VALUE}}', | |
| 7651 | + ], | |
| 7652 | + ] | |
| 7653 | + ); | |
| 7654 | + | |
| 7655 | + $this->add_control( | |
| 7656 | + 'tax2_bg_color_hr', | |
| 7657 | + [ | |
| 7658 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 7659 | + 'type' => Controls_Manager::COLOR, | |
| 7660 | + 'default' => '#4D02D8', | |
| 7661 | + 'selectors' => [ | |
| 7662 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'background-color: {{VALUE}}', | |
| 7663 | + ] | |
| 7664 | + ] | |
| 7665 | + ); | |
| 7666 | + | |
| 7667 | + $this->add_control( | |
| 7668 | + 'tax2_border_color_hr', | |
| 7669 | + [ | |
| 7670 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 7671 | + 'type' => Controls_Manager::COLOR, | |
| 7672 | + 'default' => '#E8E8E8', | |
| 7673 | + 'selectors' => [ | |
| 7674 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a:hover' => 'border-color: {{VALUE}}', | |
| 7675 | + ], | |
| 7676 | + ] | |
| 7677 | + ); | |
| 7678 | + | |
| 7679 | + $this->add_control_tax2_pointer_color_hr(); | |
| 7680 | + | |
| 7681 | + $this->end_controls_tab(); | |
| 7682 | + | |
| 7683 | + $this->end_controls_tabs(); | |
| 7684 | + | |
| 7685 | + $this->add_control_tax2_pointer(); | |
| 7686 | + | |
| 7687 | + $this->add_control_tax2_pointer_height(); | |
| 7688 | + | |
| 7689 | + $this->add_control_tax2_pointer_animation(); | |
| 7690 | + | |
| 7691 | + $this->add_control( | |
| 7692 | + 'tax2_transition_duration', | |
| 7693 | + [ | |
| 7694 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 7695 | + 'type' => Controls_Manager::NUMBER, | |
| 7696 | + 'default' => 0.1, | |
| 7697 | + 'min' => 0, | |
| 7698 | + 'max' => 5, | |
| 7699 | + 'step' => 0.1, | |
| 7700 | + 'selectors' => [ | |
| 7701 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'transition-duration: {{VALUE}}s', | |
| 7702 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s', | |
| 7703 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s', | |
| 7704 | + ], | |
| 7705 | + 'separator' => 'after', | |
| 7706 | + ] | |
| 7707 | + ); | |
| 7708 | + | |
| 7709 | + $this->add_group_control( | |
| 7710 | + Group_Control_Typography::get_type(), | |
| 7711 | + [ | |
| 7712 | + 'name' => 'tax2_typography', | |
| 7713 | + 'selector' => '{{WRAPPER}} .king-addons-grid-tax-style-2' | |
| 7714 | + ] | |
| 7715 | + ); | |
| 7716 | + | |
| 7717 | + $this->add_control( | |
| 7718 | + 'tax2_border_type', | |
| 7719 | + [ | |
| 7720 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 7721 | + 'type' => Controls_Manager::SELECT, | |
| 7722 | + 'options' => [ | |
| 7723 | + 'none' => esc_html__('None', 'king-addons'), | |
| 7724 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 7725 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 7726 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 7727 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 7728 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 7729 | + ], | |
| 7730 | + 'default' => 'none', | |
| 7731 | + 'selectors' => [ | |
| 7732 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-style: {{VALUE}};', | |
| 7733 | + ], | |
| 7734 | + 'render_type' => 'template', | |
| 7735 | + 'separator' => 'before', | |
| 7736 | + ] | |
| 7737 | + ); | |
| 7738 | + | |
| 7739 | + $this->add_control( | |
| 7740 | + 'tax2_border_width', | |
| 7741 | + [ | |
| 7742 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 7743 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7744 | + 'size_units' => ['px'], | |
| 7745 | + 'default' => [ | |
| 7746 | + 'top' => 1, | |
| 7747 | + 'right' => 1, | |
| 7748 | + 'bottom' => 1, | |
| 7749 | + 'left' => 1, | |
| 7750 | + ], | |
| 7751 | + 'selectors' => [ | |
| 7752 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7753 | + ], | |
| 7754 | + 'render_type' => 'template', | |
| 7755 | + 'condition' => [ | |
| 7756 | + 'tax2_border_type!' => 'none', | |
| 7757 | + ], | |
| 7758 | + ] | |
| 7759 | + ); | |
| 7760 | + | |
| 7761 | + $this->add_control( | |
| 7762 | + 'tax2_text_spacing', | |
| 7763 | + [ | |
| 7764 | + 'label' => esc_html__('Extra Text Spacing', 'king-addons'), | |
| 7765 | + 'type' => Controls_Manager::SLIDER, | |
| 7766 | + 'size_units' => ['px'], | |
| 7767 | + 'range' => [ | |
| 7768 | + 'px' => [ | |
| 7769 | + 'min' => 0, | |
| 7770 | + 'max' => 25, | |
| 7771 | + ], | |
| 7772 | + ], | |
| 7773 | + 'default' => [ | |
| 7774 | + 'unit' => 'px', | |
| 7775 | + 'size' => 5, | |
| 7776 | + ], | |
| 7777 | + 'selectors' => [ | |
| 7778 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 7779 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 7780 | + ], | |
| 7781 | + 'separator' => 'before', | |
| 7782 | + ] | |
| 7783 | + ); | |
| 7784 | + | |
| 7785 | + $this->add_control( | |
| 7786 | + 'tax2_icon_spacing', | |
| 7787 | + [ | |
| 7788 | + 'label' => esc_html__('Extra Icon Spacing', 'king-addons'), | |
| 7789 | + 'type' => Controls_Manager::SLIDER, | |
| 7790 | + 'size_units' => ['px'], | |
| 7791 | + 'range' => [ | |
| 7792 | + 'px' => [ | |
| 7793 | + 'min' => 0, | |
| 7794 | + 'max' => 25, | |
| 7795 | + ], | |
| 7796 | + ], | |
| 7797 | + 'default' => [ | |
| 7798 | + 'unit' => 'px', | |
| 7799 | + 'size' => 5, | |
| 7800 | + ], | |
| 7801 | + 'selectors' => [ | |
| 7802 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', | |
| 7803 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', | |
| 7804 | + ], | |
| 7805 | + ] | |
| 7806 | + ); | |
| 7807 | + | |
| 7808 | + $this->add_control( | |
| 7809 | + 'tax2_gutter', | |
| 7810 | + [ | |
| 7811 | + 'label' => esc_html__('Gutter', 'king-addons'), | |
| 7812 | + 'type' => Controls_Manager::SLIDER, | |
| 7813 | + 'size_units' => ['px'], | |
| 7814 | + 'range' => [ | |
| 7815 | + 'px' => [ | |
| 7816 | + 'min' => 0, | |
| 7817 | + 'max' => 20, | |
| 7818 | + ], | |
| 7819 | + ], | |
| 7820 | + 'default' => [ | |
| 7821 | + 'unit' => 'px', | |
| 7822 | + 'size' => 3, | |
| 7823 | + ], | |
| 7824 | + 'selectors' => [ | |
| 7825 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 7826 | + ], | |
| 7827 | + 'render_type' => 'template', | |
| 7828 | + 'separator' => 'before', | |
| 7829 | + ] | |
| 7830 | + ); | |
| 7831 | + | |
| 7832 | + $this->add_responsive_control( | |
| 7833 | + 'tax2_padding', | |
| 7834 | + [ | |
| 7835 | + 'label' => esc_html__('Padding', 'king-addons'), | |
| 7836 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7837 | + 'size_units' => ['px', '%'], | |
| 7838 | + 'default' => [ | |
| 7839 | + 'top' => 0, | |
| 7840 | + 'right' => 10, | |
| 7841 | + 'bottom' => 0, | |
| 7842 | + 'left' => 10, | |
| 7843 | + ], | |
| 7844 | + 'selectors' => [ | |
| 7845 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7846 | + ], | |
| 7847 | + 'render_type' => 'template', | |
| 7848 | + ] | |
| 7849 | + ); | |
| 7850 | + | |
| 7851 | + $this->add_responsive_control( | |
| 7852 | + 'tax2_margin', | |
| 7853 | + [ | |
| 7854 | + 'label' => esc_html__('Margin', 'king-addons'), | |
| 7855 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7856 | + 'size_units' => ['px', '%'], | |
| 7857 | + 'default' => [ | |
| 7858 | + 'top' => 0, | |
| 7859 | + 'right' => 0, | |
| 7860 | + 'bottom' => 0, | |
| 7861 | + 'left' => 0, | |
| 7862 | + ], | |
| 7863 | + 'selectors' => [ | |
| 7864 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7865 | + ], | |
| 7866 | + 'render_type' => 'template', | |
| 7867 | + ] | |
| 7868 | + ); | |
| 7869 | + | |
| 7870 | + $this->add_control( | |
| 7871 | + 'tax2_radius', | |
| 7872 | + [ | |
| 7873 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 7874 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 7875 | + 'size_units' => ['px', '%'], | |
| 7876 | + 'default' => [ | |
| 7877 | + 'top' => 3, | |
| 7878 | + 'right' => 3, | |
| 7879 | + 'bottom' => 3, | |
| 7880 | + 'left' => 3, | |
| 7881 | + ], | |
| 7882 | + 'selectors' => [ | |
| 7883 | + '{{WRAPPER}} .king-addons-grid-tax-style-2 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 7884 | + ], | |
| 7885 | + 'separator' => 'before', | |
| 7886 | + ] | |
| 7887 | + ); | |
| 7888 | + | |
| 7889 | + $this->end_controls_section(); | |
| 7890 | + | |
| 7891 | + | |
| 7892 | + $this->add_section_style_custom_field1(); | |
| 7893 | + | |
| 7894 | + | |
| 7895 | + $this->add_section_style_custom_field2(); | |
| 7896 | + | |
| 7897 | + | |
| 7898 | + $this->add_section_style_custom_field3(); | |
| 7899 | + | |
| 7900 | + | |
| 7901 | + $this->add_section_style_custom_field4(); | |
| 7902 | + | |
| 7903 | + | |
| 7904 | + $this->start_controls_section( | |
| 7905 | + 'settings_section_style_grid_slider_nav', | |
| 7906 | + [ | |
| 7907 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Slider Navigation', 'king-addons'), | |
| 7908 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 7909 | + 'condition' => [ | |
| 7910 | + 'layout_select' => 'slider', | |
| 7911 | + ], | |
| 7912 | + ] | |
| 7913 | + ); | |
| 7914 | + | |
| 7915 | + $this->start_controls_tabs('tabs_grid_slider_nav_style'); | |
| 7916 | + | |
| 7917 | + $this->start_controls_tab( | |
| 7918 | + 'tab_grid_slider_nav_normal', | |
| 7919 | + [ | |
| 7920 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 7921 | + ] | |
| 7922 | + ); | |
| 7923 | + | |
| 7924 | + $this->add_control( | |
| 7925 | + 'grid_slider_nav_color', | |
| 7926 | + [ | |
| 7927 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 7928 | + 'type' => Controls_Manager::COLOR, | |
| 7929 | + 'default' => '#5B03FF', | |
| 7930 | + 'selectors' => [ | |
| 7931 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'color: {{VALUE}};', | |
| 7932 | + '{{WRAPPER}} .king-addons-grid-slider-arrow svg' => 'fill: {{VALUE}};', | |
| 7933 | + ], | |
| 7934 | + ] | |
| 7935 | + ); | |
| 7936 | + | |
| 7937 | + $this->add_control( | |
| 7938 | + 'grid_slider_nav_bg_color', | |
| 7939 | + [ | |
| 7940 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 7941 | + 'type' => Controls_Manager::COLOR, | |
| 7942 | + 'selectors' => [ | |
| 7943 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'background-color: {{VALUE}};', | |
| 7944 | + ], | |
| 7945 | + ] | |
| 7946 | + ); | |
| 7947 | + | |
| 7948 | + $this->add_control( | |
| 7949 | + 'grid_slider_nav_border_color', | |
| 7950 | + [ | |
| 7951 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 7952 | + 'type' => Controls_Manager::COLOR, | |
| 7953 | + 'default' => 'rgba(255,255,255,0.8)', | |
| 7954 | + 'selectors' => [ | |
| 7955 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-color: {{VALUE}};', | |
| 7956 | + ], | |
| 7957 | + ] | |
| 7958 | + ); | |
| 7959 | + | |
| 7960 | + $this->end_controls_tab(); | |
| 7961 | + | |
| 7962 | + $this->start_controls_tab( | |
| 7963 | + 'tab_grid_slider_nav_hover', | |
| 7964 | + [ | |
| 7965 | + 'label' => esc_html__('Hover', 'king-addons'), | |
| 7966 | + ] | |
| 7967 | + ); | |
| 7968 | + | |
| 7969 | + $this->add_control( | |
| 7970 | + 'grid_slider_nav_hover_color', | |
| 7971 | + [ | |
| 7972 | + 'label' => esc_html__('Color', 'king-addons'), | |
| 7973 | + 'type' => Controls_Manager::COLOR, | |
| 7974 | + 'default' => '#4D02D8', | |
| 7975 | + 'selectors' => [ | |
| 7976 | + '{{WRAPPER}} .king-addons-grid-slider-arrow:hover' => 'color: {{VALUE}};', | |
| 7977 | + '{{WRAPPER}} .king-addons-grid-slider-arrow:hover svg' => 'fill: {{VALUE}};', | |
| 7978 | + ], | |
| 7979 | + ] | |
| 7980 | + ); | |
| 7981 | + | |
| 7982 | + $this->add_control( | |
| 7983 | + 'grid_slider_nav_hover_bg_color', | |
| 7984 | + [ | |
| 7985 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 7986 | + 'type' => Controls_Manager::COLOR, | |
| 7987 | + 'selectors' => [ | |
| 7988 | + '{{WRAPPER}} .king-addons-grid-slider-arrow:hover' => 'background-color: {{VALUE}};', | |
| 7989 | + ], | |
| 7990 | + ] | |
| 7991 | + ); | |
| 7992 | + | |
| 7993 | + $this->add_control( | |
| 7994 | + 'grid_slider_nav_hover_border_color', | |
| 7995 | + [ | |
| 7996 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 7997 | + 'type' => Controls_Manager::COLOR, | |
| 7998 | + 'selectors' => [ | |
| 7999 | + '{{WRAPPER}} .king-addons-grid-slider-arrow:hover' => 'border-color: {{VALUE}};', | |
| 8000 | + ], | |
| 8001 | + ] | |
| 8002 | + ); | |
| 8003 | + | |
| 8004 | + $this->end_controls_tab(); | |
| 8005 | + | |
| 8006 | + $this->end_controls_tabs(); | |
| 8007 | + | |
| 8008 | + $this->add_control( | |
| 8009 | + 'grid_slider_nav_transition_duration', | |
| 8010 | + [ | |
| 8011 | + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'), | |
| 8012 | + 'type' => Controls_Manager::NUMBER, | |
| 8013 | + 'default' => 0.1, | |
| 8014 | + 'min' => 0, | |
| 8015 | + 'max' => 5, | |
| 8016 | + 'step' => 0.1, | |
| 8017 | + 'selectors' => [ | |
| 8018 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'transition-duration: {{VALUE}}s', | |
| 8019 | + '{{WRAPPER}} .king-addons-grid-slider-arrow svg' => 'transition-duration: {{VALUE}}s', | |
| 8020 | + ], | |
| 8021 | + 'separator' => 'before', | |
| 8022 | + ] | |
| 8023 | + ); | |
| 8024 | + | |
| 8025 | + $this->add_responsive_control( | |
| 8026 | + 'grid_slider_nav_font_size', | |
| 8027 | + [ | |
| 8028 | + 'label' => esc_html__('Font Size', 'king-addons'), | |
| 8029 | + 'type' => Controls_Manager::SLIDER, | |
| 8030 | + 'size_units' => ['px',], | |
| 8031 | + 'range' => [ | |
| 8032 | + 'px' => [ | |
| 8033 | + 'min' => 10, | |
| 8034 | + 'max' => 200, | |
| 8035 | + ], | |
| 8036 | + ], | |
| 8037 | + 'default' => [ | |
| 8038 | + 'unit' => 'px', | |
| 8039 | + 'size' => 25, | |
| 8040 | + ], | |
| 8041 | + 'selectors' => [ | |
| 8042 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 8043 | + '{{WRAPPER}} .king-addons-grid-slider-arrow svg' => 'width: {{SIZE}}{{UNIT}};', | |
| 8044 | + ], | |
| 8045 | + 'separator' => 'before', | |
| 8046 | + ] | |
| 8047 | + ); | |
| 8048 | + | |
| 8049 | + $this->add_responsive_control( | |
| 8050 | + 'grid_slider_nav_size', | |
| 8051 | + [ | |
| 8052 | + 'label' => esc_html__('Box Size', 'king-addons'), | |
| 8053 | + 'type' => Controls_Manager::SLIDER, | |
| 8054 | + 'size_units' => ['px',], | |
| 8055 | + 'range' => [ | |
| 8056 | + 'px' => [ | |
| 8057 | + 'min' => 10, | |
| 8058 | + 'max' => 200, | |
| 8059 | + ], | |
| 8060 | + ], | |
| 8061 | + 'default' => [ | |
| 8062 | + 'unit' => 'px', | |
| 8063 | + 'size' => 60, | |
| 8064 | + ], | |
| 8065 | + 'selectors' => [ | |
| 8066 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', | |
| 8067 | + ], | |
| 8068 | + 'separator' => 'after', | |
| 8069 | + ] | |
| 8070 | + ); | |
| 8071 | + | |
| 8072 | + $this->add_control( | |
| 8073 | + 'grid_slider_nav_border_type', | |
| 8074 | + [ | |
| 8075 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 8076 | + 'type' => Controls_Manager::SELECT, | |
| 8077 | + 'options' => [ | |
| 8078 | + 'none' => esc_html__('None', 'king-addons'), | |
| 8079 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 8080 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 8081 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 8082 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 8083 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 8084 | + ], | |
| 8085 | + 'default' => 'none', | |
| 8086 | + 'selectors' => [ | |
| 8087 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-style: {{VALUE}};', | |
| 8088 | + ], | |
| 8089 | + ] | |
| 8090 | + ); | |
| 8091 | + | |
| 8092 | + $this->add_control( | |
| 8093 | + 'grid_slider_nav_border_width', | |
| 8094 | + [ | |
| 8095 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 8096 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 8097 | + 'size_units' => ['px'], | |
| 8098 | + 'default' => [ | |
| 8099 | + 'top' => 2, | |
| 8100 | + 'right' => 2, | |
| 8101 | + 'bottom' => 2, | |
| 8102 | + 'left' => 2, | |
| 8103 | + ], | |
| 8104 | + 'selectors' => [ | |
| 8105 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 8106 | + ], | |
| 8107 | + 'condition' => [ | |
| 8108 | + 'grid_slider_nav_border_type!' => 'none', | |
| 8109 | + ], | |
| 8110 | + ] | |
| 8111 | + ); | |
| 8112 | + | |
| 8113 | + $this->add_control( | |
| 8114 | + 'grid_slider_nav_border_radius', | |
| 8115 | + [ | |
| 8116 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 8117 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 8118 | + 'size_units' => ['px', '%'], | |
| 8119 | + 'selectors' => [ | |
| 8120 | + '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 8121 | + ], | |
| 8122 | + 'separator' => 'after', | |
| 8123 | + ] | |
| 8124 | + ); | |
| 8125 | + | |
| 8126 | + $this->add_control_stack_grid_slider_nav_position(); | |
| 8127 | + | |
| 8128 | + $this->end_controls_section(); | |
| 8129 | + | |
| 8130 | + | |
| 8131 | + $this->start_controls_section( | |
| 8132 | + 'settings_section_style_grid_slider_dots', | |
| 8133 | + [ | |
| 8134 | + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Slider Pagination', 'king-addons'), | |
| 8135 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 8136 | + 'condition' => [ | |
| 8137 | + 'layout_select' => 'slider', | |
| 8138 | + ], | |
| 8139 | + ] | |
| 8140 | + ); | |
| 8141 | + | |
| 8142 | + $this->start_controls_tabs('tabs_grid_slider_dots'); | |
| 8143 | + | |
| 8144 | + $this->start_controls_tab( | |
| 8145 | + 'tab_grid_slider_dots_normal', | |
| 8146 | + [ | |
| 8147 | + 'label' => esc_html__('Normal', 'king-addons'), | |
| 8148 | + ] | |
| 8149 | + ); | |
| 8150 | + | |
| 8151 | + $this->add_control( | |
| 8152 | + 'grid_slider_dots_bg_color', | |
| 8153 | + [ | |
| 8154 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 8155 | + 'type' => Controls_Manager::COLOR, | |
| 8156 | + 'default' => 'rgba(0,0,0,0.35)', | |
| 8157 | + 'selectors' => [ | |
| 8158 | + '{{WRAPPER}} .king-addons-grid-slider-dot' => 'background-color: {{VALUE}};', | |
| 8159 | + ], | |
| 8160 | + ] | |
| 8161 | + ); | |
| 8162 | + | |
| 8163 | + $this->add_control( | |
| 8164 | + 'grid_slider_dots_border_color', | |
| 8165 | + [ | |
| 8166 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 8167 | + 'type' => Controls_Manager::COLOR, | |
| 8168 | + 'selectors' => [ | |
| 8169 | + '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-color: {{VALUE}}', | |
| 8170 | + ], | |
| 8171 | + ] | |
| 8172 | + ); | |
| 8173 | + | |
| 8174 | + $this->end_controls_tab(); | |
| 8175 | + | |
| 8176 | + $this->start_controls_tab( | |
| 8177 | + 'tab_grid_slider_dots_active', | |
| 8178 | + [ | |
| 8179 | + 'label' => esc_html__('Active', 'king-addons'), | |
| 8180 | + ] | |
| 8181 | + ); | |
| 8182 | + | |
| 8183 | + $this->add_control( | |
| 8184 | + 'grid_slider_dots_active_bg_color', | |
| 8185 | + [ | |
| 8186 | + 'label' => esc_html__('Background Color', 'king-addons'), | |
| 8187 | + 'type' => Controls_Manager::COLOR, | |
| 8188 | + 'default' => '#5B03FF', | |
| 8189 | + 'selectors' => [ | |
| 8190 | + '{{WRAPPER}} .king-addons-grid-slider-dots .slick-active .king-addons-grid-slider-dot' => 'background-color: {{VALUE}}', | |
| 8191 | + ], | |
| 8192 | + ] | |
| 8193 | + ); | |
| 8194 | + | |
| 8195 | + $this->add_control( | |
| 8196 | + 'grid_slider_dots_active_border_color', | |
| 8197 | + [ | |
| 8198 | + 'label' => esc_html__('Border Color', 'king-addons'), | |
| 8199 | + 'type' => Controls_Manager::COLOR, | |
| 8200 | + 'selectors' => [ | |
| 8201 | + '{{WRAPPER}} .king-addons-grid-slider-dots .slick-active .king-addons-grid-slider-dot' => 'border-color: {{VALUE}}', | |
| 8202 | + ], | |
| 8203 | + ] | |
| 8204 | + ); | |
| 8205 | + | |
| 8206 | + $this->end_controls_tab(); | |
| 8207 | + | |
| 8208 | + $this->end_controls_tabs(); | |
| 8209 | + | |
| 8210 | + $this->add_responsive_control( | |
| 8211 | + 'grid_slider_dots_width', | |
| 8212 | + [ | |
| 8213 | + 'label' => esc_html__('Box Width', 'king-addons'), | |
| 8214 | + 'type' => Controls_Manager::SLIDER, | |
| 8215 | + 'size_units' => ['px',], | |
| 8216 | + 'range' => [ | |
| 8217 | + 'px' => [ | |
| 8218 | + 'min' => 1, | |
| 8219 | + 'max' => 100, | |
| 8220 | + ], | |
| 8221 | + ], | |
| 8222 | + 'default' => [ | |
| 8223 | + 'unit' => 'px', | |
| 8224 | + 'size' => 8, | |
| 8225 | + ], | |
| 8226 | + 'selectors' => [ | |
| 8227 | + '{{WRAPPER}} .king-addons-grid-slider-dot' => 'width: {{SIZE}}{{UNIT}};', | |
| 8228 | + ], | |
| 8229 | + 'separator' => 'before', | |
| 8230 | + 'render_type' => 'template' | |
| 8231 | + ] | |
| 8232 | + ); | |
| 8233 | + | |
| 8234 | + $this->add_responsive_control( | |
| 8235 | + 'grid_slider_dots_height', | |
| 8236 | + [ | |
| 8237 | + 'label' => esc_html__('Box Height', 'king-addons'), | |
| 8238 | + 'type' => Controls_Manager::SLIDER, | |
| 8239 | + 'size_units' => ['px',], | |
| 8240 | + 'range' => [ | |
| 8241 | + 'px' => [ | |
| 8242 | + 'min' => 1, | |
| 8243 | + 'max' => 100, | |
| 8244 | + ], | |
| 8245 | + ], | |
| 8246 | + 'default' => [ | |
| 8247 | + 'unit' => 'px', | |
| 8248 | + 'size' => 8, | |
| 8249 | + ], | |
| 8250 | + 'selectors' => [ | |
| 8251 | + '{{WRAPPER}} .king-addons-grid-slider-dot' => 'height: {{SIZE}}{{UNIT}};', | |
| 8252 | + ], | |
| 8253 | + 'render_type' => 'template' | |
| 8254 | + ] | |
| 8255 | + ); | |
| 8256 | + | |
| 8257 | + $this->add_control( | |
| 8258 | + 'grid_slider_dots_border_type', | |
| 8259 | + [ | |
| 8260 | + 'label' => esc_html__('Border Type', 'king-addons'), | |
| 8261 | + 'type' => Controls_Manager::SELECT, | |
| 8262 | + 'options' => [ | |
| 8263 | + 'none' => esc_html__('None', 'king-addons'), | |
| 8264 | + 'solid' => esc_html__('Solid', 'king-addons'), | |
| 8265 | + 'double' => esc_html__('Double', 'king-addons'), | |
| 8266 | + 'dotted' => esc_html__('Dotted', 'king-addons'), | |
| 8267 | + 'dashed' => esc_html__('Dashed', 'king-addons'), | |
| 8268 | + 'groove' => esc_html__('Groove', 'king-addons'), | |
| 8269 | + ], | |
| 8270 | + 'default' => 'none', | |
| 8271 | + 'selectors' => [ | |
| 8272 | + '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-style: {{VALUE}};', | |
| 8273 | + ], | |
| 8274 | + 'render_type' => 'template', | |
| 8275 | + 'separator' => 'before', | |
| 8276 | + ] | |
| 8277 | + ); | |
| 8278 | + | |
| 8279 | + $this->add_control( | |
| 8280 | + 'grid_slider_dots_border_width', | |
| 8281 | + [ | |
| 8282 | + 'label' => esc_html__('Border Width', 'king-addons'), | |
| 8283 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 8284 | + 'size_units' => ['px'], | |
| 8285 | + 'default' => [ | |
| 8286 | + 'top' => 1, | |
| 8287 | + 'right' => 1, | |
| 8288 | + 'bottom' => 1, | |
| 8289 | + 'left' => 1, | |
| 8290 | + ], | |
| 8291 | + 'selectors' => [ | |
| 8292 | + '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 8293 | + ], | |
| 8294 | + 'render_type' => 'template', | |
| 8295 | + 'condition' => [ | |
| 8296 | + 'grid_slider_dots_border_type!' => 'none', | |
| 8297 | + ], | |
| 8298 | + ] | |
| 8299 | + ); | |
| 8300 | + | |
| 8301 | + $this->add_control( | |
| 8302 | + 'grid_slider_dots_border_radius', | |
| 8303 | + [ | |
| 8304 | + 'label' => esc_html__('Border Radius', 'king-addons'), | |
| 8305 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 8306 | + 'default' => [ | |
| 8307 | + 'top' => 50, | |
| 8308 | + 'right' => 50, | |
| 8309 | + 'bottom' => 50, | |
| 8310 | + 'left' => 50, | |
| 8311 | + 'unit' => '%', | |
| 8312 | + ], | |
| 8313 | + 'size_units' => ['px', '%'], | |
| 8314 | + 'selectors' => [ | |
| 8315 | + '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 8316 | + ], | |
| 8317 | + 'separator' => 'before', | |
| 8318 | + ] | |
| 8319 | + ); | |
| 8320 | + | |
| 8321 | + $this->add_responsive_control( | |
| 8322 | + 'grid_slider_dots_gutter', | |
| 8323 | + [ | |
| 8324 | + 'type' => Controls_Manager::SLIDER, | |
| 8325 | + 'label' => esc_html__('Gutter', 'king-addons'), | |
| 8326 | + 'size_units' => ['px'], | |
| 8327 | + 'range' => [ | |
| 8328 | + 'px' => [ | |
| 8329 | + 'min' => 0, | |
| 8330 | + 'max' => 100, | |
| 8331 | + ], | |
| 8332 | + ], | |
| 8333 | + 'default' => [ | |
| 8334 | + 'unit' => 'px', | |
| 8335 | + 'size' => 7, | |
| 8336 | + ], | |
| 8337 | + 'selectors' => [ | |
| 8338 | + '{{WRAPPER}}.king-addons-grid-slider-dots-horizontal .king-addons-grid-slider-dot' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 8339 | + '{{WRAPPER}}.king-addons-grid-slider-dots-vertical .king-addons-grid-slider-dot' => 'margin-bottom: {{SIZE}}{{UNIT}};', | |
| 8340 | + ], | |
| 8341 | + 'render_type' => 'template', | |
| 8342 | + 'separator' => 'before', | |
| 8343 | + ] | |
| 8344 | + ); | |
| 8345 | + | |
| 8346 | + $this->add_control_grid_slider_dots_hr(); | |
| 8347 | + | |
| 8348 | + $this->add_responsive_control( | |
| 8349 | + 'grid_slider_dots_vr', | |
| 8350 | + [ | |
| 8351 | + 'type' => Controls_Manager::SLIDER, | |
| 8352 | + 'label' => esc_html__('Vertical Position', 'king-addons'), | |
| 8353 | + 'size_units' => ['%', 'px'], | |
| 8354 | + 'range' => [ | |
| 8355 | + '%' => [ | |
| 8356 | + 'min' => -20, | |
| 8357 | + 'max' => 120, | |
| 8358 | + ], | |
| 8359 | + 'px' => [ | |
| 8360 | + 'min' => -200, | |
| 8361 | + 'max' => 2000, | |
| 8362 | + ], | |
| 8363 | + ], | |
| 8364 | + 'default' => [ | |
| 8365 | + 'unit' => '%', | |
| 8366 | + 'size' => 96, | |
| 8367 | + ], | |
| 8368 | + 'selectors' => [ | |
| 8369 | + '{{WRAPPER}} .king-addons-grid-slider-dots' => 'top: {{SIZE}}{{UNIT}};', | |
| 8370 | + ], | |
| 8371 | + ] | |
| 8372 | + ); | |
| 8373 | + | |
| 8374 | + $this->end_controls_section(); | |
| 8375 | + | |
| 8376 | + } | |
| 8377 | + | |
| 8378 | + public function get_related_taxonomies() | |
| 8379 | + { | |
| 8380 | + $post_types = Core::getCustomTypes('post', false); | |
| 8381 | + $relations = []; | |
| 8382 | + | |
| 8383 | + // Simply assign the array returned by get_object_taxonomies() to avoid extra loops | |
| 8384 | + foreach ($post_types as $slug => $title) { | |
| 8385 | + $relations[$slug] = get_object_taxonomies($slug); | |
| 8386 | + } | |
| 8387 | + | |
| 8388 | + return json_encode($relations); | |
| 8389 | + } | |
| 8390 | + | |
| 8391 | + public function get_max_num_pages() | |
| 8392 | + { | |
| 8393 | + $query = new WP_Query($this->get_main_query_args()); | |
| 8394 | + $max_num_pages = (int)ceil($query->max_num_pages); | |
| 8395 | + wp_reset_postdata(); | |
| 8396 | + return $max_num_pages; | |
| 8397 | + } | |
| 8398 | + | |
| 8399 | + public function get_main_query_args() | |
| 8400 | + { | |
| 8401 | + $settings = Core::displaySettings($this); | |
| 8402 | + | |
| 8403 | + // Detect paged | |
| 8404 | + $paged = get_query_var('paged') ?: (get_query_var('page') ?: 1); | |
| 8405 | + | |
| 8406 | + // Build author string if needed | |
| 8407 | + $author = !empty($settings['query_author']) ? implode(',', $settings['query_author']) : ''; | |
| 8408 | + | |
| 8409 | + // Adjust posts_per_page for slider (premium check) | |
| 8410 | + if ( | |
| 8411 | + 'slider' === $settings['layout_select'] && | |
| 8412 | + king_addons_freemius()->can_use_premium_code__premium_only() | |
| 8413 | + ) { | |
| 8414 | + $slidesToShow = $settings['query_slides_to_show'] ?: -1; | |
| 8415 | + $settings['query_posts_per_page'] = min($slidesToShow, 4); | |
| 8416 | + } | |
| 8417 | + | |
| 8418 | + // Slider forces paged to 1 | |
| 8419 | + if ('slider' === $settings['layout_select']) { | |
| 8420 | + $paged = 1; | |
| 8421 | + } | |
| 8422 | + | |
| 8423 | + // Ensure offset is set | |
| 8424 | + $settings['query_offset'] = $settings['query_offset'] ?? 0; | |
| 8425 | + | |
| 8426 | + // Calculate offset | |
| 8427 | + $postsPerPage = $settings['query_posts_per_page'] ?? 0; | |
| 8428 | + if (empty($postsPerPage) && !( | |
| 8429 | + 'slider' === $settings['layout_select'] && | |
| 8430 | + king_addons_freemius()->can_use_premium_code__premium_only() | |
| 8431 | + )) { | |
| 8432 | + $postsPerPage = 999; | |
| 8433 | + } | |
| 8434 | + | |
| 8435 | + $offset = ($paged - 1) * (int)$postsPerPage + (int)$settings['query_offset']; | |
| 8436 | + | |
| 8437 | + // If premium not available, reset certain settings | |
| 8438 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 8439 | + $settings['query_randomize'] = ''; | |
| 8440 | + $settings['order_posts'] = 'date'; | |
| 8441 | + } | |
| 8442 | + | |
| 8443 | + // Determine "orderby" | |
| 8444 | + $query_order_by = !empty($settings['query_randomize']) | |
| 8445 | + ? $settings['query_randomize'] | |
| 8446 | + : $settings['order_posts']; | |
| 8447 | + | |
| 8448 | + // Determine excluded posts array | |
| 8449 | + $excludeKey = 'query_exclude_' . $settings['query_source']; | |
| 8450 | + $post__not_in = !empty($settings[$excludeKey]) ? $settings[$excludeKey] : []; | |
| 8451 | + | |
| 8452 | + // Default query args | |
| 8453 | + $args = [ | |
| 8454 | + 'post_type' => $settings['query_source'], | |
| 8455 | + 'tax_query' => $this->get_tax_query_args(), | |
| 8456 | + 'post__not_in' => $post__not_in, | |
| 8457 | + 'posts_per_page' => $postsPerPage, | |
| 8458 | + 'orderby' => $query_order_by, | |
| 8459 | + 'author' => $author, | |
| 8460 | + 'paged' => $paged, | |
| 8461 | + 'offset' => $offset, | |
| 8462 | + ]; | |
| 8463 | + | |
| 8464 | + // Handle meta_value ordering | |
| 8465 | + if ('meta_value' === $query_order_by) { | |
| 8466 | + $args['meta_key'] = $settings['order_posts_by_acf']; | |
| 8467 | + } | |
| 8468 | + | |
| 8469 | + // Handle scheduled/future posts | |
| 8470 | + $args['post_status'] = ( | |
| 8471 | + 'yes' === $settings['display_scheduled_posts'] && | |
| 8472 | + king_addons_freemius()->can_use_premium_code__premium_only() | |
| 8473 | + ) | |
| 8474 | + ? 'future' | |
| 8475 | + : 'publish'; | |
| 8476 | + | |
| 8477 | + // Exclude posts with no thumbnail if requested | |
| 8478 | + if ('yes' === $settings['query_exclude_no_images']) { | |
| 8479 | + $args['meta_key'] = '_thumbnail_id'; | |
| 8480 | + } | |
| 8481 | + | |
| 8482 | + // MANUAL selection overrides everything else | |
| 8483 | + if ('manual' === $settings['query_selection']) { | |
| 8484 | + $manualKey = 'query_manual_' . $settings['query_source']; | |
| 8485 | + $post_ids = !empty($settings[$manualKey]) ? $settings[$manualKey] : ['']; | |
| 8486 | + | |
| 8487 | + $args = [ | |
| 8488 | + 'post_type' => $settings['query_source'], | |
| 8489 | + 'post__in' => $post_ids, | |
| 8490 | + 'ignore_sticky_posts' => 1, | |
| 8491 | + 'posts_per_page' => $postsPerPage, | |
| 8492 | + 'orderby' => $query_order_by, | |
| 8493 | + 'paged' => $paged, | |
| 8494 | + ]; | |
| 8495 | + } | |
| 8496 | + | |
| 8497 | + // "CURRENT" uses global $wp_query | |
| 8498 | + if ('current' === $settings['query_source']) { | |
| 8499 | + global $wp_query; | |
| 8500 | + $args = $wp_query->query_vars; | |
| 8501 | + $args['orderby'] = $query_order_by; | |
| 8502 | + | |
| 8503 | + if (is_post_type_archive()) { | |
| 8504 | + $args['posts_per_page'] = (int)get_option('king_addons_cpt_ppp_' . $args['post_type'], 10); | |
| 8505 | + } else { | |
| 8506 | + $args['posts_per_page'] = (int)get_option('posts_per_page'); | |
| 8507 | + } | |
| 8508 | + | |
| 8509 | + $args['offset'] = ($paged - 1) * $args['posts_per_page'] + (int)$settings['query_offset']; | |
| 8510 | + | |
| 8511 | + // Build a small tax_query if categories are passed in GET | |
| 8512 | + $tax_query = []; | |
| 8513 | + foreach (['category', 'king_addons_select_category'] as $catParam) { | |
| 8514 | + if (!empty($_GET[$catParam]) && $_GET[$catParam] !== '0') { | |
| 8515 | + $tax_query[] = [ | |
| 8516 | + 'taxonomy' => 'category', | |
| 8517 | + 'field' => 'id', | |
| 8518 | + 'terms' => sanitize_text_field($_GET[$catParam]), | |
| 8519 | + ]; | |
| 8520 | + } | |
| 8521 | + } | |
| 8522 | + if (!empty($tax_query)) { | |
| 8523 | + $args['tax_query'] = $tax_query; | |
| 8524 | + } | |
| 8525 | + } | |
| 8526 | + | |
| 8527 | + // "RELATED" posts | |
| 8528 | + if ('related' === $settings['query_source']) { | |
| 8529 | + $args = [ | |
| 8530 | + 'post_type' => get_post_type(get_the_ID()), | |
| 8531 | + 'tax_query' => $this->get_tax_query_args(), | |
| 8532 | + 'post__not_in' => [get_the_ID()], | |
| 8533 | + 'ignore_sticky_posts' => 1, | |
| 8534 | + 'posts_per_page' => $postsPerPage, | |
| 8535 | + 'orderby' => $query_order_by, | |
| 8536 | + 'offset' => $offset, | |
| 8537 | + ]; | |
| 8538 | + } | |
| 8539 | + | |
| 8540 | + // Order direction (unless random) | |
| 8541 | + if ('rand' !== $query_order_by) { | |
| 8542 | + $args['order'] = $settings['order_direction']; | |
| 8543 | + } | |
| 8544 | + | |
| 8545 | + return $args; | |
| 8546 | + } | |
| 8547 | + | |
| 8548 | + public function get_tax_query_args() | |
| 8549 | + { | |
| 8550 | + $settings = Core::displaySettings($this); | |
| 8551 | + | |
| 8552 | + // "RELATED" means match the same terms as current post in a chosen taxonomy | |
| 8553 | + if ('related' === $settings['query_source']) { | |
| 8554 | + return [[ | |
| 8555 | + 'taxonomy' => $settings['query_tax_selection'], | |
| 8556 | + 'field' => 'term_id', | |
| 8557 | + 'terms' => wp_get_object_terms( | |
| 8558 | + get_the_ID(), | |
| 8559 | + $settings['query_tax_selection'], | |
| 8560 | + ['fields' => 'ids'] | |
| 8561 | + ), | |
| 8562 | + ]]; | |
| 8563 | + } | |
| 8564 | + | |
| 8565 | + // Otherwise, gather chosen taxonomies | |
| 8566 | + $tax_query = []; | |
| 8567 | + $taxonomies = get_object_taxonomies($settings['query_source']); | |
| 8568 | + | |
| 8569 | + foreach ($taxonomies as $tax) { | |
| 8570 | + $fieldKey = 'query_taxonomy_' . $tax; | |
| 8571 | + if (!empty($settings[$fieldKey])) { | |
| 8572 | + $tax_query[] = [ | |
| 8573 | + 'taxonomy' => $tax, | |
| 8574 | + 'field' => 'id', | |
| 8575 | + 'terms' => $settings[$fieldKey], | |
| 8576 | + ]; | |
| 8577 | + } | |
| 8578 | + } | |
| 8579 | + return $tax_query; | |
| 8580 | + } | |
| 8581 | + | |
| 8582 | + public function get_animation_class($data, $object) | |
| 8583 | + { | |
| 8584 | + // Disable if mobile + disable-mobile setting | |
| 8585 | + if ( | |
| 8586 | + 'overlay' !== $object && | |
| 8587 | + 'yes' === ($data[$object . '_animation_disable_mobile'] ?? '') && | |
| 8588 | + wp_is_mobile() | |
| 8589 | + ) { | |
| 8590 | + return ''; | |
| 8591 | + } | |
| 8592 | + | |
| 8593 | + $class = ''; | |
| 8594 | + $anim = $data[$object . '_animation'] ?? 'none'; | |
| 8595 | + | |
| 8596 | + if ('none' !== $anim) { | |
| 8597 | + $class .= ' king-addons-' . $object . '-' . $anim; | |
| 8598 | + $class .= ' king-addons-anim-size-' . ($data[$object . '_animation_size'] ?? ''); | |
| 8599 | + $class .= ' king-addons-animation-timing-' . ($data[$object . '_animation_timing'] ?? ''); | |
| 8600 | + if ('yes' === ($data[$object . '_animation_tr'] ?? '')) { | |
| 8601 | + $class .= ' king-addons-anim-transparency'; | |
| 8602 | + } | |
| 8603 | + } | |
| 8604 | + return $class; | |
| 8605 | + } | |
| 8606 | + | |
| 8607 | + public function get_image_effect_class($settings) | |
| 8608 | + { | |
| 8609 | + // Restrict effects if premium not available | |
| 8610 | + if ( | |
| 8611 | + !king_addons_freemius()->can_use_premium_code__premium_only() && | |
| 8612 | + in_array($settings['image_effects'], ['pro-zi', 'pro-zo', 'pro-go', 'pro-bo']) | |
| 8613 | + ) { | |
| 8614 | + $settings['image_effects'] = 'none'; | |
| 8615 | + } | |
| 8616 | + | |
| 8617 | + $class = ''; | |
| 8618 | + $effect = $settings['image_effects'] ?? 'none'; | |
| 8619 | + | |
| 8620 | + if ('none' !== $effect) { | |
| 8621 | + $class .= ' king-addons-' . $effect; | |
| 8622 | + } | |
| 8623 | + | |
| 8624 | + // For 'slide' vs other effect directions | |
| 8625 | + if ('slide' !== $effect) { | |
| 8626 | + $class .= ' king-addons-effect-size-' . ($settings['image_effects_size'] ?? ''); | |
| 8627 | + } else { | |
| 8628 | + $class .= ' king-addons-effect-dir-' . ($settings['image_effects_direction'] ?? ''); | |
| 8629 | + } | |
| 8630 | + | |
| 8631 | + return $class; | |
| 8632 | + } | |
| 8633 | + | |
| 8634 | + public function render_password_protected_input() | |
| 8635 | + { | |
| 8636 | + if (!post_password_required()) { | |
| 8637 | + return; | |
| 8638 | + } | |
| 8639 | + | |
| 8640 | + add_filter('the_password_form', function () { | |
| 8641 | + $output = '<form action="' . esc_url(home_url('wp-login.php?action=postpass')) . '" method="post">'; | |
| 8642 | + $output .= '<i class="fas fa-lock"></i>'; | |
| 8643 | + $output .= '<p>' . esc_html(get_the_title()) . '</p>'; | |
| 8644 | + $output .= '<input type="password" name="post_password" id="post-' . esc_attr(get_the_id()) . '" placeholder="' . esc_html__('Type and hit Enter...', 'king-addons') . '">'; | |
| 8645 | + $output .= '</form>'; | |
| 8646 | + return $output; | |
| 8647 | + }); | |
| 8648 | + | |
| 8649 | + echo '<div class="king-addons-grid-item-protected king-addons-cv-container">'; | |
| 8650 | + echo ' <div class="king-addons-cv-outer">'; | |
| 8651 | + echo ' <div class="king-addons-cv-inner">'; | |
| 8652 | + echo get_the_password_form(); | |
| 8653 | + echo ' </div>'; | |
| 8654 | + echo ' </div>'; | |
| 8655 | + echo '</div>'; | |
| 8656 | + } | |
| 8657 | + | |
| 8658 | + public function render_post_thumbnail($settings) | |
| 8659 | + { | |
| 8660 | + $id = get_post_thumbnail_id(); | |
| 8661 | + $src = Group_Control_Image_Size::get_attachment_image_src($id, 'layout_image_crop', $settings); | |
| 8662 | + | |
| 8663 | + // A post with no featured image would otherwise drop the whole media block, | |
| 8664 | + // and the cards beside it in the row would no longer line up. | |
| 8665 | + if (!$src) { | |
| 8666 | + $src = Utils::get_placeholder_image_src(); | |
| 8667 | + } | |
| 8668 | + | |
| 8669 | + // Secondary image | |
| 8670 | + $sec_meta = get_post_meta(get_the_ID(), 'king_addons_secondary_image_id', true); | |
| 8671 | + $src2 = !empty($sec_meta) | |
| 8672 | + ? Group_Control_Image_Size::get_attachment_image_src($sec_meta, 'layout_image_crop', $settings) | |
| 8673 | + : ''; | |
| 8674 | + | |
| 8675 | + // Determine alt | |
| 8676 | + $alt = '' === wp_get_attachment_caption($id) | |
| 8677 | + ? get_the_title() | |
| 8678 | + : wp_get_attachment_caption($id); | |
| 8679 | + | |
| 8680 | + echo '<div class="king-addons-grid-image-wrap" data-src="' . esc_url($src) . '" data-img-on-hover="' . esc_attr($settings['secondary_img_on_hover']) . '" data-src-secondary="' . esc_url($src2) . '">'; | |
| 8681 | + | |
| 8682 | + // Lazy loading vs normal | |
| 8683 | + /** @noinspection PhpIfWithCommonPartsInspection */ | |
| 8684 | + if ('yes' === $settings['grid_lazy_loading']) { | |
| 8685 | + echo '<img loading="lazy" src="'.esc_url($src).'" | |
| 8686 | + alt="' . esc_attr($alt) . '" class="king-addons-hidden-image king-addons-animation-timing-' . esc_attr($settings['image_effects_animation_timing']) . '">'; | |
| 8687 | + if ('yes' === $settings['secondary_img_on_hover']) { | |
| 8688 | + echo '<img src="' . esc_url($src2) . '" alt="' . esc_attr($alt) . '" class="king-addons-hidden-img king-addons-animation-timing-' . esc_attr($settings['image_effects_animation_timing']) . '">'; | |
| 8689 | + } | |
| 8690 | + } else { | |
| 8691 | + echo '<img src="' . esc_url($src) . '" alt="' . esc_attr($alt) . '" class="king-addons-animation-timing-' . esc_attr($settings['image_effects_animation_timing']) . '">'; | |
| 8692 | + if ('yes' === $settings['secondary_img_on_hover']) { | |
| 8693 | + echo '<img src="' . esc_url($src2) . '" alt="' . esc_attr($alt) . '" class="king-addons-hidden-img king-addons-animation-timing-' . esc_attr($settings['image_effects_animation_timing']) . '">'; | |
| 8694 | + } | |
| 8695 | + } | |
| 8696 | + echo '</div>'; | |
| 8697 | + } | |
| 8698 | + | |
| 8699 | + public function render_media_overlay($settings) | |
| 8700 | + { | |
| 8701 | + echo '<div class="king-addons-grid-media-hover-bg ' . esc_attr($this->get_animation_class($settings, 'overlay')) . '" data-url="' . esc_url(get_the_permalink()) . '">'; | |
| 8702 | + if (king_addons_freemius()->can_use_premium_code__premium_only() && !empty($settings['overlay_image']['url'])) { | |
| 8703 | + echo '<img src="' . esc_url($settings['overlay_image']['url']) . '" alt="' . esc_attr($settings['overlay_image']['alt']) . '">'; | |
| 8704 | + } | |
| 8705 | + echo '</div>'; | |
| 8706 | + } | |
| 8707 | + | |
| 8708 | + public function render_post_title($settings, $class) | |
| 8709 | + { | |
| 8710 | + // Fallback pointer for non-premium | |
| 8711 | + $title_pointer = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 8712 | + ? (Core::displaySettings($this)['title_pointer'] ?? 'none') | |
| 8713 | + : 'none'; | |
| 8714 | + $title_pointer_animation = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 8715 | + ? (Core::displaySettings($this)['title_pointer_animation'] ?? 'fade') | |
| 8716 | + : 'fade'; | |
| 8717 | + | |
| 8718 | + $pointer_item_class = ($title_pointer !== 'none') | |
| 8719 | + ? 'class="king-addons-pointer-item"' | |
| 8720 | + : ''; | |
| 8721 | + | |
| 8722 | + $new_tab = ('yes' === Core::displaySettings($this)['open_links_in_new_tab']) ? '_blank' : '_self'; | |
| 8723 | + | |
| 8724 | + $class .= ' king-addons-pointer-' . $title_pointer; | |
| 8725 | + $class .= ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $title_pointer_animation; | |
| 8726 | + | |
| 8727 | + // Validate allowed HTML tags | |
| 8728 | + $tags_whitelist = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p']; | |
| 8729 | + $element_title_tag = Core::validateHTMLTags($settings['element_title_tag'], 'h2', $tags_whitelist); | |
| 8730 | + | |
| 8731 | + echo '<' . esc_attr($element_title_tag) . ' class="' . esc_attr($class) . '">'; | |
| 8732 | + echo ' <div class="inner-block">'; | |
| 8733 | + echo ' <a target="' . esc_attr($new_tab) . '" ' . $pointer_item_class . ' href="' . esc_url(get_the_permalink()) . '">'; | |
| 8734 | + if ('word_count' === $settings['element_trim_text_by']) { | |
| 8735 | + echo esc_html(wp_trim_words(get_the_title(), $settings['element_word_count'])); | |
| 8736 | + } else { | |
| 8737 | + echo esc_html(mb_substr(html_entity_decode(get_the_title()), 0, $settings['element_letter_count'])) . '...'; | |
| 8738 | + } | |
| 8739 | + echo ' </a>'; | |
| 8740 | + echo ' </div>'; | |
| 8741 | + echo '</' . esc_attr($element_title_tag) . '>'; | |
| 8742 | + } | |
| 8743 | + | |
| 8744 | + public function render_post_content($settings, $class) | |
| 8745 | + { | |
| 8746 | + if ('' === get_the_content()) { | |
| 8747 | + return; | |
| 8748 | + } | |
| 8749 | + if ('yes' === $settings['element_dropcap']) { | |
| 8750 | + $class .= ' king-addons-enable-dropcap'; | |
| 8751 | + } | |
| 8752 | + | |
| 8753 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8754 | + echo ' <div class="inner-block">'; | |
| 8755 | + echo wp_kses_post(apply_filters('the_content', get_the_content())); | |
| 8756 | + echo ' </div>'; | |
| 8757 | + echo '</div>'; | |
| 8758 | + } | |
| 8759 | + | |
| 8760 | + public function render_post_excerpt($settings, $class) | |
| 8761 | + { | |
| 8762 | + if ('' === get_the_excerpt()) { | |
| 8763 | + return; | |
| 8764 | + } | |
| 8765 | + if ('yes' === $settings['element_dropcap']) { | |
| 8766 | + $class .= ' king-addons-enable-dropcap'; | |
| 8767 | + } | |
| 8768 | + | |
| 8769 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8770 | + echo ' <div class="inner-block">'; | |
| 8771 | + if ('word_count' === $settings['element_trim_text_by']) { | |
| 8772 | + echo '<p>' . esc_html(wp_trim_words(get_the_excerpt(), $settings['element_word_count'])) . '</p>'; | |
| 8773 | + } else { | |
| 8774 | + // slice letters | |
| 8775 | + $excerptLetters = implode('', array_slice(str_split(get_the_excerpt()), 0, $settings['element_letter_count'])); | |
| 8776 | + echo '<p>' . esc_html($excerptLetters) . '...</p>'; | |
| 8777 | + } | |
| 8778 | + echo ' </div>'; | |
| 8779 | + echo '</div>'; | |
| 8780 | + } | |
| 8781 | + | |
| 8782 | + public function render_post_date($settings, $class) | |
| 8783 | + { | |
| 8784 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8785 | + echo ' <div class="inner-block">'; | |
| 8786 | + echo ' <span>'; | |
| 8787 | + | |
| 8788 | + if ('before' === $settings['element_extra_text_pos']) { | |
| 8789 | + echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8790 | + } | |
| 8791 | + if ('before' === $settings['element_extra_icon_pos']) { | |
| 8792 | + ob_start(); | |
| 8793 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8794 | + $icon = ob_get_clean(); | |
| 8795 | + echo '<span class="king-addons-grid-extra-icon-left">' . $icon . '</span>'; | |
| 8796 | + } | |
| 8797 | + | |
| 8798 | + if ('yes' === $settings['show_last_update_date']) { | |
| 8799 | + echo esc_html(get_the_modified_time(get_option('date_format'))); | |
| 8800 | + } else { | |
| 8801 | + echo esc_html(apply_filters('the_date', get_the_date(), get_option('date_format'), '', '')); | |
| 8802 | + } | |
| 8803 | + | |
| 8804 | + if ('after' === $settings['element_extra_icon_pos']) { | |
| 8805 | + ob_start(); | |
| 8806 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8807 | + $icon = ob_get_clean(); | |
| 8808 | + echo '<span class="king-addons-grid-extra-icon-right">' . $icon . '</span>'; | |
| 8809 | + } | |
| 8810 | + if ('after' === $settings['element_extra_text_pos']) { | |
| 8811 | + echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8812 | + } | |
| 8813 | + | |
| 8814 | + echo ' </span>'; | |
| 8815 | + echo ' </div>'; | |
| 8816 | + echo '</div>'; | |
| 8817 | + } | |
| 8818 | + | |
| 8819 | + public function render_post_time($settings, $class) | |
| 8820 | + { | |
| 8821 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8822 | + echo ' <div class="inner-block">'; | |
| 8823 | + echo ' <span>'; | |
| 8824 | + | |
| 8825 | + if ('before' === $settings['element_extra_text_pos']) { | |
| 8826 | + echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8827 | + } | |
| 8828 | + if ('before' === $settings['element_extra_icon_pos']) { | |
| 8829 | + ob_start(); | |
| 8830 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8831 | + $icon = ob_get_clean(); | |
| 8832 | + echo '<span class="king-addons-grid-extra-icon-left">' . $icon . '</span>'; | |
| 8833 | + } | |
| 8834 | + | |
| 8835 | + echo esc_html(get_the_time()); | |
| 8836 | + | |
| 8837 | + if ('after' === $settings['element_extra_icon_pos']) { | |
| 8838 | + ob_start(); | |
| 8839 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8840 | + $icon = ob_get_clean(); | |
| 8841 | + echo '<span class="king-addons-grid-extra-icon-right">' . $icon . '</span>'; | |
| 8842 | + } | |
| 8843 | + if ('after' === $settings['element_extra_text_pos']) { | |
| 8844 | + echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8845 | + } | |
| 8846 | + | |
| 8847 | + echo ' </span>'; | |
| 8848 | + echo ' </div>'; | |
| 8849 | + echo '</div>'; | |
| 8850 | + } | |
| 8851 | + | |
| 8852 | + public function render_post_author($settings, $class) | |
| 8853 | + { | |
| 8854 | + $author_id = get_post_field('post_author'); | |
| 8855 | + | |
| 8856 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8857 | + echo ' <div class="inner-block">'; | |
| 8858 | + | |
| 8859 | + if ('before' === $settings['element_extra_text_pos']) { | |
| 8860 | + echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8861 | + } | |
| 8862 | + | |
| 8863 | + echo '<a href="' . esc_url(get_author_posts_url($author_id)) . '">'; | |
| 8864 | + | |
| 8865 | + if ('before' === $settings['element_extra_icon_pos']) { | |
| 8866 | + ob_start(); | |
| 8867 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8868 | + $icon = ob_get_clean(); | |
| 8869 | + echo '<span class="king-addons-grid-extra-icon-left">' . $icon . '</span>'; | |
| 8870 | + } | |
| 8871 | + if ('yes' === $settings['element_show_avatar']) { | |
| 8872 | + echo get_avatar($author_id, $settings['element_avatar_size']); | |
| 8873 | + } | |
| 8874 | + | |
| 8875 | + echo '<span>' . esc_html(get_the_author_meta('display_name', $author_id)) . '</span>'; | |
| 8876 | + | |
| 8877 | + if ('after' === $settings['element_extra_icon_pos']) { | |
| 8878 | + ob_start(); | |
| 8879 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8880 | + $icon = ob_get_clean(); | |
| 8881 | + echo '<span class="king-addons-grid-extra-icon-right">' . $icon . '</span>'; | |
| 8882 | + } | |
| 8883 | + | |
| 8884 | + echo '</a>'; | |
| 8885 | + | |
| 8886 | + if ('after' === $settings['element_extra_text_pos']) { | |
| 8887 | + echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8888 | + } | |
| 8889 | + | |
| 8890 | + echo ' </div>'; | |
| 8891 | + echo '</div>'; | |
| 8892 | + } | |
| 8893 | + | |
| 8894 | + public function render_post_comments($settings, $class) | |
| 8895 | + { | |
| 8896 | + if (!comments_open()) { | |
| 8897 | + return; | |
| 8898 | + } | |
| 8899 | + | |
| 8900 | + $count = get_comments_number(); | |
| 8901 | + if ($count == 1) { | |
| 8902 | + $text = $count . ' ' . $settings['element_comments_text_2']; | |
| 8903 | + } elseif ($count > 1) { | |
| 8904 | + $text = $count . ' ' . $settings['element_comments_text_3']; | |
| 8905 | + } else { | |
| 8906 | + $text = $settings['element_comments_text_1']; | |
| 8907 | + } | |
| 8908 | + | |
| 8909 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8910 | + echo ' <div class="inner-block">'; | |
| 8911 | + | |
| 8912 | + if ('before' === $settings['element_extra_text_pos']) { | |
| 8913 | + echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8914 | + } | |
| 8915 | + | |
| 8916 | + echo '<a href="' . esc_url(get_comments_link()) . '">'; | |
| 8917 | + | |
| 8918 | + if ('before' === $settings['element_extra_icon_pos']) { | |
| 8919 | + ob_start(); | |
| 8920 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8921 | + $icon = ob_get_clean(); | |
| 8922 | + echo '<span class="king-addons-grid-extra-icon-left">' . $icon . '</span>'; | |
| 8923 | + } | |
| 8924 | + | |
| 8925 | + echo '<span>' . esc_html($text) . '</span>'; | |
| 8926 | + | |
| 8927 | + if ('after' === $settings['element_extra_icon_pos']) { | |
| 8928 | + ob_start(); | |
| 8929 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8930 | + $icon = ob_get_clean(); | |
| 8931 | + echo '<span class="king-addons-grid-extra-icon-right">' . $icon . '</span>'; | |
| 8932 | + } | |
| 8933 | + | |
| 8934 | + echo '</a>'; | |
| 8935 | + | |
| 8936 | + if ('after' === $settings['element_extra_text_pos']) { | |
| 8937 | + echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 8938 | + } | |
| 8939 | + | |
| 8940 | + echo ' </div>'; | |
| 8941 | + echo '</div>'; | |
| 8942 | + } | |
| 8943 | + | |
| 8944 | + public function render_post_read_more($settings, $class) | |
| 8945 | + { | |
| 8946 | + // Fallback animation for non-premium | |
| 8947 | + $read_more_animation = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 8948 | + ? Core::displaySettings($this)['read_more_animation'] | |
| 8949 | + : 'king-addons-button-none'; | |
| 8950 | + | |
| 8951 | + $new_tab = ('yes' === Core::displaySettings($this)['open_links_in_new_tab']) ? '_blank' : '_self'; | |
| 8952 | + | |
| 8953 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8954 | + echo ' <div class="inner-block">'; | |
| 8955 | + echo ' <a target="' . esc_attr($new_tab) . '" href="' . esc_url(get_the_permalink()) . '" class="king-addons-button-effect ' . esc_attr($read_more_animation) . '">'; | |
| 8956 | + | |
| 8957 | + if ('before' === $settings['element_extra_icon_pos']) { | |
| 8958 | + ob_start(); | |
| 8959 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8960 | + $icon = ob_get_clean(); | |
| 8961 | + echo '<span class="king-addons-grid-extra-icon-left">' . $icon . '</span>'; | |
| 8962 | + } | |
| 8963 | + | |
| 8964 | + echo '<span>' . esc_html($settings['element_read_more_text']) . '</span>'; | |
| 8965 | + | |
| 8966 | + if ('after' === $settings['element_extra_icon_pos']) { | |
| 8967 | + ob_start(); | |
| 8968 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 8969 | + $icon = ob_get_clean(); | |
| 8970 | + echo '<span class="king-addons-grid-extra-icon-right">' . $icon . '</span>'; | |
| 8971 | + } | |
| 8972 | + | |
| 8973 | + echo ' </a>'; | |
| 8974 | + echo ' </div>'; | |
| 8975 | + echo '</div>'; | |
| 8976 | + } | |
| 8977 | + | |
| 8978 | + // Placeholder for premium-protected items | |
| 8979 | + public function render_post_likes($settings, $class, $post_id) | |
| 8980 | + { | |
| 8981 | + } | |
| 8982 | + | |
| 8983 | + public function render_post_sharing_icons($settings, $class) | |
| 8984 | + { | |
| 8985 | + } | |
| 8986 | + | |
| 8987 | + public function render_post_custom_field($settings, $class, $post_id) | |
| 8988 | + { | |
| 8989 | + } | |
| 8990 | + | |
| 8991 | + public function render_post_lightbox($settings, $class, $post_id) | |
| 8992 | + { | |
| 8993 | + echo '<div class="' . esc_attr($class) . '">'; | |
| 8994 | + echo ' <div class="inner-block">'; | |
| 8995 | + | |
| 8996 | + // Default to post thumbnail if set | |
| 8997 | + $lightbox_source = get_the_post_thumbnail_url($post_id); | |
| 8998 | + | |
| 8999 | + // Handle Audio/Video meta | |
| 9000 | + if ('audio' === get_post_format()) { | |
| 9001 | + if ('meta' === $settings['element_lightbox_pfa_select']) { | |
| 9002 | + $meta_value = get_post_meta($post_id, $settings['element_lightbox_pfa_meta'], true); | |
| 9003 | + // Attempt to oEmbed | |
| 9004 | + if (false === strpos($meta_value, '<iframe ')) { | |
| 9005 | + add_filter('oembed_result', $posts_grid_filter = function ($html) { | |
| 9006 | + preg_match('/<iframe.*src=\"(.*)\".*><\/iframe>/isU', $html, $matches); | |
| 9007 | + return $matches[1] . '&auto_play=true'; | |
| 9008 | + }, 50, 3); | |
| 9009 | + $track_url = wp_oembed_get($meta_value); | |
| 9010 | + remove_filter('oembed_result', $posts_grid_filter, 50); | |
| 9011 | + } else { | |
| 9012 | + $track_url = Core::filterOembedResults($meta_value); | |
| 9013 | + } | |
| 9014 | + $lightbox_source = $track_url; | |
| 9015 | + } | |
| 9016 | + } elseif ('video' === get_post_format()) { | |
| 9017 | + if ('meta' === $settings['element_lightbox_pfv_select']) { | |
| 9018 | + $meta_value = get_post_meta($post_id, $settings['element_lightbox_pfv_meta'], true); | |
| 9019 | + if (false === strpos($meta_value, '<iframe ')) { | |
| 9020 | + $video = Embed::get_video_properties($meta_value); | |
| 9021 | + } else { | |
| 9022 | + $video = Embed::get_video_properties(Core::filterOembedResults($meta_value)); | |
| 9023 | + } | |
| 9024 | + | |
| 9025 | + if (isset($video['provider'], $video['video_id'])) { | |
| 9026 | + if ('youtube' === $video['provider']) { | |
| 9027 | + $lightbox_source = 'https://www.youtube.com/embed/' . $video['video_id'] . '?feature=oembed&autoplay=1&controls=1'; | |
| 9028 | + } elseif ('vimeo' === $video['provider']) { | |
| 9029 | + $lightbox_source = 'https://player.vimeo.com/video/' . $video['video_id'] . '?autoplay=1#t=0'; | |
| 9030 | + } | |
| 9031 | + } | |
| 9032 | + } | |
| 9033 | + } | |
| 9034 | + | |
| 9035 | + echo ' <span data-src="' . esc_url($lightbox_source) . '">'; | |
| 9036 | + | |
| 9037 | + if ('before' === $settings['element_extra_text_pos']) { | |
| 9038 | + echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 9039 | + } | |
| 9040 | + | |
| 9041 | + echo ' <i class="' . esc_attr($settings['element_extra_icon']['value']) . '"></i>'; | |
| 9042 | + | |
| 9043 | + if ('after' === $settings['element_extra_text_pos']) { | |
| 9044 | + echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 9045 | + } | |
| 9046 | + | |
| 9047 | + echo ' </span>'; | |
| 9048 | + | |
| 9049 | + if ('yes' === $settings['element_lightbox_overlay']) { | |
| 9050 | + echo '<div class="king-addons-grid-lightbox-overlay"></div>'; | |
| 9051 | + } | |
| 9052 | + | |
| 9053 | + echo ' </div>'; | |
| 9054 | + echo '</div>'; | |
| 9055 | + } | |
| 9056 | + | |
| 9057 | + public function render_post_element_separator($settings, $class) | |
| 9058 | + { | |
| 9059 | + echo '<div class="' . esc_attr($class . ' ' . $settings['element_separator_style']) . '">'; | |
| 9060 | + echo ' <div class="inner-block"><span></span></div>'; | |
| 9061 | + echo '</div>'; | |
| 9062 | + } | |
| 9063 | + | |
| 9064 | + public function render_post_taxonomies($settings, $class, $post_id) | |
| 9065 | + { | |
| 9066 | + $terms = wp_get_post_terms($post_id, $settings['element_select']); | |
| 9067 | + if (empty($terms)) { | |
| 9068 | + return; | |
| 9069 | + } | |
| 9070 | + | |
| 9071 | + // Handle pointer classes (premium or fallback) | |
| 9072 | + $tax1_pointer = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 9073 | + ? (Core::displaySettings($this)['tax1_pointer'] ?? 'none') | |
| 9074 | + : 'none'; | |
| 9075 | + $tax1_pointer_animation = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 9076 | + ? (Core::displaySettings($this)['tax1_pointer_animation'] ?? 'fade') | |
| 9077 | + : 'fade'; | |
| 9078 | + $tax2_pointer = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 9079 | + ? (Core::displaySettings($this)['tax2_pointer'] ?? 'none') | |
| 9080 | + : 'none'; | |
| 9081 | + $tax2_pointer_animation = king_addons_freemius()->can_use_premium_code__premium_only() | |
| 9082 | + ? (Core::displaySettings($this)['tax2_pointer_animation'] ?? 'fade') | |
| 9083 | + : 'fade'; | |
| 9084 | + | |
| 9085 | + // Decide which pointer to use | |
| 9086 | + if ('king-addons-grid-tax-style-1' === $settings['element_tax_style']) { | |
| 9087 | + $class .= ' king-addons-pointer-' . $tax1_pointer; | |
| 9088 | + $class .= ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $tax1_pointer_animation; | |
| 9089 | + } else { | |
| 9090 | + $class .= ' king-addons-pointer-' . $tax2_pointer; | |
| 9091 | + $class .= ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $tax2_pointer_animation; | |
| 9092 | + } | |
| 9093 | + | |
| 9094 | + echo '<div class="' . esc_attr($class . ' ' . $settings['element_tax_style']) . '">'; | |
| 9095 | + echo ' <div class="inner-block">'; | |
| 9096 | + | |
| 9097 | + if ('before' === $settings['element_extra_text_pos']) { | |
| 9098 | + echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 9099 | + } | |
| 9100 | + if ('before' === $settings['element_extra_icon_pos']) { | |
| 9101 | + ob_start(); | |
| 9102 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 9103 | + $icon = ob_get_clean(); | |
| 9104 | + echo '<span class="king-addons-grid-extra-icon-left">' . $icon . '</span>'; | |
| 9105 | + } | |
| 9106 | + | |
| 9107 | + $count = 0; | |
| 9108 | + $sep = esc_html($settings['element_tax_sep'] ?? ''); | |
| 9109 | + $pointer = (($tax1_pointer !== 'none') || ($tax2_pointer !== 'none')) ? 'king-addons-pointer-item' : ''; | |
| 9110 | + | |
| 9111 | + foreach ($terms as $term) { | |
| 9112 | + // Possibly set custom colors (premium) for tax style 1 | |
| 9113 | + if ( | |
| 9114 | + 'yes' === (Core::displaySettings($this)['tax1_custom_color_switcher'] ?? '') && | |
| 9115 | + 'king-addons-grid-tax-style-1' === $settings['element_tax_style'] | |
| 9116 | + ) { | |
| 9117 | + $cfc_text = get_term_meta($term->term_id, Core::displaySettings($this)['tax1_custom_color_field_text'], true); | |
| 9118 | + $cfc_bg = get_term_meta($term->term_id, Core::displaySettings($this)['tax1_custom_color_field_bg'], true); | |
| 9119 | + $color_css = "color:$cfc_text; background-color:$cfc_bg; border-color:$cfc_bg;"; | |
| 9120 | + $custom_selector = '.elementor-element' . $this->get_unique_selector() . | |
| 9121 | + ' .king-addons-grid-tax-style-1 .inner-block a.king-addons-tax-id-' . esc_attr($term->term_id); | |
| 9122 | + echo '<style>' . $custom_selector . '{' . $color_css . '}</style>'; | |
| 9123 | + } | |
| 9124 | + | |
| 9125 | + echo '<a class="' . $pointer . ' king-addons-tax-id-' . esc_attr($term->term_id) . '" href="' . esc_url(get_term_link($term->term_id)) . '">'; | |
| 9126 | + echo esc_html($term->name); | |
| 9127 | + if (++$count !== count($terms)) { | |
| 9128 | + echo '<span class="tax-sep">' . $sep . '</span>'; | |
| 9129 | + } | |
| 9130 | + echo '</a>'; | |
| 9131 | + } | |
| 9132 | + | |
| 9133 | + if ('after' === $settings['element_extra_icon_pos']) { | |
| 9134 | + ob_start(); | |
| 9135 | + Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); | |
| 9136 | + $icon = ob_get_clean(); | |
| 9137 | + echo '<span class="king-addons-grid-extra-icon-right">' . $icon . '</span>'; | |
| 9138 | + } | |
| 9139 | + if ('after' === $settings['element_extra_text_pos']) { | |
| 9140 | + echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>'; | |
| 9141 | + } | |
| 9142 | + | |
| 9143 | + echo ' </div>'; | |
| 9144 | + echo '</div>'; | |
| 9145 | + } | |
| 9146 | + | |
| 9147 | + public function get_elements($type, $settings, $class, $post_id) | |
| 9148 | + { | |
| 9149 | + // Fallback for certain pro elements | |
| 9150 | + if (in_array($type, ['pro-lk', 'pro-shr', 'pro-cf'])) { | |
| 9151 | + $type = 'title'; | |
| 9152 | + } | |
| 9153 | + | |
| 9154 | + switch ($type) { | |
| 9155 | + case 'title': | |
| 9156 | + $this->render_post_title($settings, $class); | |
| 9157 | + break; | |
| 9158 | + case 'content': | |
| 9159 | + $this->render_post_content($settings, $class); | |
| 9160 | + break; | |
| 9161 | + case 'excerpt': | |
| 9162 | + $this->render_post_excerpt($settings, $class); | |
| 9163 | + break; | |
| 9164 | + case 'date': | |
| 9165 | + $this->render_post_date($settings, $class); | |
| 9166 | + break; | |
| 9167 | + case 'time': | |
| 9168 | + $this->render_post_time($settings, $class); | |
| 9169 | + break; | |
| 9170 | + case 'author': | |
| 9171 | + $this->render_post_author($settings, $class); | |
| 9172 | + break; | |
| 9173 | + case 'comments': | |
| 9174 | + $this->render_post_comments($settings, $class); | |
| 9175 | + break; | |
| 9176 | + case 'read-more': | |
| 9177 | + $this->render_post_read_more($settings, $class); | |
| 9178 | + break; | |
| 9179 | + case 'likes': | |
| 9180 | + $this->render_post_likes($settings, $class, $post_id); | |
| 9181 | + break; | |
| 9182 | + case 'sharing': | |
| 9183 | + $this->render_post_sharing_icons($settings, $class); | |
| 9184 | + break; | |
| 9185 | + case 'lightbox': | |
| 9186 | + $this->render_post_lightbox($settings, $class, $post_id); | |
| 9187 | + break; | |
| 9188 | + case 'custom-field': | |
| 9189 | + $this->render_post_custom_field($settings, $class, $post_id); | |
| 9190 | + break; | |
| 9191 | + case 'separator': | |
| 9192 | + $this->render_post_element_separator($settings, $class); | |
| 9193 | + break; | |
| 9194 | + default: | |
| 9195 | + $this->render_post_taxonomies($settings, $class, $post_id); | |
| 9196 | + } | |
| 9197 | + } | |
| 9198 | + | |
| 9199 | + public function get_elements_by_location($location, $settings, $post_id) | |
| 9200 | + { | |
| 9201 | + $locations = []; | |
| 9202 | + | |
| 9203 | + // Group elements by location; also group "over" by vertical alignment | |
| 9204 | + foreach ($settings['grid_elements'] as $data) { | |
| 9205 | + $place = $data['element_location']; | |
| 9206 | + $alignV = $data['element_align_vr']; | |
| 9207 | + | |
| 9208 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 9209 | + $alignV = 'middle'; | |
| 9210 | + } | |
| 9211 | + | |
| 9212 | + if (!isset($locations[$place])) { | |
| 9213 | + $locations[$place] = []; | |
| 9214 | + } | |
| 9215 | + | |
| 9216 | + if ('over' === $place) { | |
| 9217 | + if (!isset($locations[$place][$alignV])) { | |
| 9218 | + $locations[$place][$alignV] = []; | |
| 9219 | + } | |
| 9220 | + $locations[$place][$alignV][] = $data; | |
| 9221 | + } else { | |
| 9222 | + $locations[$place][] = $data; | |
| 9223 | + } | |
| 9224 | + } | |
| 9225 | + | |
| 9226 | + // Render each group of elements | |
| 9227 | + if (!empty($locations[$location])) { | |
| 9228 | + if ('over' === $location) { | |
| 9229 | + foreach ($locations[$location] as $align => $elements) { | |
| 9230 | + if ('middle' === $align) { | |
| 9231 | + echo '<div class="king-addons-cv-container"><div class="king-addons-cv-outer"><div class="king-addons-cv-inner">'; | |
| 9232 | + } | |
| 9233 | + echo '<div class="king-addons-grid-media-hover-' . esc_attr($align) . ' elementor-clearfix">'; | |
| 9234 | + | |
| 9235 | + foreach ($elements as $data) { | |
| 9236 | + $itemClass = 'king-addons-grid-item-' . $data['element_select'] | |
| 9237 | + . ' elementor-repeater-item-' . $data['_id'] | |
| 9238 | + . ' king-addons-grid-item-display-' . $data['element_display'] | |
| 9239 | + . ' king-addons-grid-item-align-' . $data['element_align_hr'] | |
| 9240 | + . $this->get_animation_class($data, 'element'); | |
| 9241 | + $this->get_elements($data['element_select'], $data, $itemClass, $post_id); | |
| 9242 | + } | |
| 9243 | + echo '</div>'; | |
| 9244 | + | |
| 9245 | + if ('middle' === $align) { | |
| 9246 | + echo '</div></div></div>'; | |
| 9247 | + } | |
| 9248 | + } | |
| 9249 | + } else { | |
| 9250 | + echo '<div class="king-addons-grid-item-' . esc_attr($location) . '-content elementor-clearfix">'; | |
| 9251 | + foreach ($locations[$location] as $data) { | |
| 9252 | + $itemClass = 'king-addons-grid-item-' . $data['element_select'] | |
| 9253 | + . ' elementor-repeater-item-' . $data['_id'] | |
| 9254 | + . ' king-addons-grid-item-display-' . $data['element_display'] | |
| 9255 | + . ' king-addons-grid-item-align-' . $data['element_align_hr']; | |
| 9256 | + $this->get_elements($data['element_select'], $data, $itemClass, $post_id); | |
| 9257 | + } | |
| 9258 | + echo '</div>'; | |
| 9259 | + } | |
| 9260 | + } | |
| 9261 | + } | |
| 9262 | + | |
| 9263 | + public function render_grid_filters($settings) | |
| 9264 | + { | |
| 9265 | + $taxonomy = $settings['filters_select'] ?? ''; | |
| 9266 | + | |
| 9267 | + // Ensure we have some taxonomy selected | |
| 9268 | + if ('' === $taxonomy || !isset($settings['query_taxonomy_' . $taxonomy])) { | |
| 9269 | + return; | |
| 9270 | + } | |
| 9271 | + | |
| 9272 | + $custom_filters = $settings['query_taxonomy_' . $taxonomy]; | |
| 9273 | + | |
| 9274 | + // Fall back for non-premium | |
| 9275 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 9276 | + $settings['filters_default_filter'] = ''; | |
| 9277 | + $settings['filters_icon_align'] = ''; | |
| 9278 | + $settings['filters_count'] = ''; | |
| 9279 | + $settings['filters_pointer'] = 'none'; | |
| 9280 | + $settings['filters_pointer_animation'] = 'none'; | |
| 9281 | + } | |
| 9282 | + | |
| 9283 | + $left_icon = ('left' === $settings['filters_icon_align']) | |
| 9284 | + ? '<i class="' . esc_attr($settings['filters_icon']['value']) . ' king-addons-grid-filters-icon-left"></i>' : ''; | |
| 9285 | + $right_icon = ('right' === $settings['filters_icon_align']) | |
| 9286 | + ? '<i class="' . esc_attr($settings['filters_icon']['value']) . ' king-addons-grid-filters-icon-right"></i>' : ''; | |
| 9287 | + $left_separator = ('left' === $settings['filters_separator_align']) | |
| 9288 | + ? '<em class="king-addons-grid-filters-sep">' . esc_html($settings['filters_separator']) . '</em>' : ''; | |
| 9289 | + $right_separator = ('right' === $settings['filters_separator_align']) | |
| 9290 | + ? '<em class="king-addons-grid-filters-sep">' . esc_html($settings['filters_separator']) . '</em>' : ''; | |
| 9291 | + $post_count = ('yes' === $settings['filters_count']) | |
| 9292 | + ? '<sup data-brackets="' . esc_attr($settings['filters_count_brackets']) . '"></sup>' | |
| 9293 | + : ''; | |
| 9294 | + | |
| 9295 | + $pointer_class = ' king-addons-pointer-' . $settings['filters_pointer']; | |
| 9296 | + $pointer_class .= ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $settings['filters_pointer_animation']; | |
| 9297 | + $pointer_item_class = ('none' !== $settings['filters_pointer']) ? 'king-addons-pointer-item' : ''; | |
| 9298 | + | |
| 9299 | + echo '<ul class="king-addons-grid-filters elementor-clearfix king-addons-grid-filters-sep-' . esc_attr($settings['filters_separator_align']) . '">'; | |
| 9300 | + | |
| 9301 | + // "Show All" button if needed | |
| 9302 | + if ('yes' === $settings['filters_all'] && 'yes' !== $settings['filters_linkable']) { | |
| 9303 | + echo '<li class="' . esc_attr($pointer_class) . '">'; | |
| 9304 | + echo ' <span data-filter="*" class="king-addons-grid-filters-item king-addons-active-filter ' . esc_attr($pointer_item_class) . '">'; | |
| 9305 | + echo $left_icon . esc_html($settings['filters_all_text']) . $right_icon . $post_count; | |
| 9306 | + echo ' </span>' . $right_separator; | |
| 9307 | + echo '</li>'; | |
| 9308 | + } | |
| 9309 | + | |
| 9310 | + $q = get_queried_object(); | |
| 9311 | + $categoryName = (is_category() && $q) ? strtolower($q->name) : 'no-category'; | |
| 9312 | + $parent_filters = []; | |
| 9313 | + | |
| 9314 | + // Dynamic | |
| 9315 | + if ($settings['query_selection'] === 'dynamic' && !empty($custom_filters)) { | |
| 9316 | + foreach ($custom_filters as $term_id) { | |
| 9317 | + $filter = get_term_by('id', $term_id, $taxonomy); | |
| 9318 | + $data_attr = ('post_tag' === $taxonomy) ? 'tag-' . $filter->slug : $taxonomy . '-' . $filter->slug; | |
| 9319 | + $tax_data = ('post_tag' === $taxonomy) ? 'tag' : $taxonomy; | |
| 9320 | + $active = (strpos($data_attr, $categoryName) !== false) ? 'king-addons-active-filter' : ''; | |
| 9321 | + | |
| 9322 | + if (0 === $filter->parent) { | |
| 9323 | + $children = get_term_children($filter->term_id, $taxonomy); | |
| 9324 | + $data_role = !empty($children) ? ' data-role="parent"' : ''; | |
| 9325 | + | |
| 9326 | + echo '<li' . $data_role . ' class="' . esc_attr($pointer_class) . '">'; | |
| 9327 | + if ('yes' !== $settings['filters_linkable']) { | |
| 9328 | + echo $left_separator . '<span class="' . $pointer_item_class . '" data-ajax-filter=\'' . json_encode([$tax_data, $filter->slug]) . '\' data-filter=".' . esc_attr(urldecode($data_attr)) . '">'; | |
| 9329 | + echo $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</span>' . $right_separator; | |
| 9330 | + } else { | |
| 9331 | + echo $left_separator . '<a class="' . $active . ' ' . $pointer_item_class . '" href="' . esc_url(get_term_link($filter->term_id, $taxonomy)) . '">'; | |
| 9332 | + echo $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</a>' . $right_separator; | |
| 9333 | + } | |
| 9334 | + echo '</li>'; | |
| 9335 | + } else { | |
| 9336 | + $parent_filters[] = $filter->parent; | |
| 9337 | + } | |
| 9338 | + } | |
| 9339 | + } else { | |
| 9340 | + // All terms from taxonomy | |
| 9341 | + $all_filters = get_terms($taxonomy); | |
| 9342 | + foreach ((array)$all_filters as $filter) { | |
| 9343 | + $data_attr = ('post_tag' === $taxonomy) ? 'tag-' . $filter->slug : $taxonomy . '-' . $filter->slug; | |
| 9344 | + $tax_data = ('post_tag' === $taxonomy) ? 'tag' : $taxonomy; | |
| 9345 | + $active = (strpos($data_attr, $categoryName) !== false) ? 'king-addons-active-filter' : ''; | |
| 9346 | + $hidden = $this->get_hidden_filter_class($filter->slug, $settings); | |
| 9347 | + | |
| 9348 | + if (0 === $filter->parent) { | |
| 9349 | + $children = get_term_children($filter->term_id, $taxonomy); | |
| 9350 | + $data_role = !empty($children) ? ' data-role="parent"' : ''; | |
| 9351 | + | |
| 9352 | + echo '<li' . $data_role . ' class="' . esc_attr($pointer_class . $hidden) . '">'; | |
| 9353 | + if ('yes' !== $settings['filters_linkable']) { | |
| 9354 | + echo $left_separator . '<span class="' . $pointer_item_class . '" data-ajax-filter=\'' . json_encode([$tax_data, $filter->slug]) . '\' data-filter=".' . esc_attr(urldecode($data_attr)) . '">'; | |
| 9355 | + echo $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</span>' . $right_separator; | |
| 9356 | + } else { | |
| 9357 | + echo $left_separator . '<a class="' . $active . ' ' . $pointer_item_class . '" href="' . esc_url(get_term_link($filter->term_id, $taxonomy)) . '" data-ajax-filter=\'' . json_encode([$tax_data, $filter->slug]) . '\' data-filter=".' . esc_attr(urldecode($data_attr)) . '">'; | |
| 9358 | + echo $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</a>' . $right_separator; | |
| 9359 | + } | |
| 9360 | + echo '</li>'; | |
| 9361 | + } else { | |
| 9362 | + $parent_filters[] = $filter->parent; | |
| 9363 | + } | |
| 9364 | + } | |
| 9365 | + } | |
| 9366 | + | |
| 9367 | + // Child terms as sub-filters if not linkable | |
| 9368 | + if ('yes' !== $settings['filters_linkable']) { | |
| 9369 | + foreach (array_unique($parent_filters) as $parent_filter) { | |
| 9370 | + $parent = get_term_by('id', $parent_filter, $taxonomy); | |
| 9371 | + $children = get_term_children($parent_filter, $taxonomy); | |
| 9372 | + $data_attr = ('post_tag' === $taxonomy) ? 'tag-' . $parent->slug : $taxonomy . '-' . $parent->slug; | |
| 9373 | + $tax_data = ('post_tag' === $taxonomy) ? 'tag' : $taxonomy; | |
| 9374 | + | |
| 9375 | + echo '<ul data-parent=".' . esc_attr(urldecode($data_attr)) . '" class="king-addons-sub-filters">'; | |
| 9376 | + echo ' <li data-role="back" class="' . esc_attr($pointer_class) . '">'; | |
| 9377 | + echo ' <span class="king-addons-back-filter" data-ajax-filter=\'' . json_encode([$tax_data, $parent->slug]) . '\' data-filter=".' . esc_attr(urldecode($data_attr)) . '">'; | |
| 9378 | + echo ' <i class="fas fa-long-arrow-alt-left"></i> ' . esc_html__('Back', 'king-addons'); | |
| 9379 | + echo ' </span>'; | |
| 9380 | + echo ' </li>'; | |
| 9381 | + | |
| 9382 | + foreach ($children as $child) { | |
| 9383 | + $sub_filter = get_term_by('id', $child, $taxonomy); | |
| 9384 | + $child_attr = ('post_tag' === $taxonomy) | |
| 9385 | + ? 'tag-' . $sub_filter->slug | |
| 9386 | + : $taxonomy . '-' . $sub_filter->slug; | |
| 9387 | + | |
| 9388 | + echo '<li data-role="sub" class="' . esc_attr($pointer_class) . '">'; | |
| 9389 | + echo $left_separator . '<span class="' . $pointer_item_class . '" data-ajax-filter=\'' . json_encode([$tax_data, $sub_filter->slug]) . '\' data-filter=".' . esc_attr(urldecode($child_attr)) . '">'; | |
| 9390 | + echo $left_icon . esc_html($sub_filter->name) . $right_icon . $post_count; | |
| 9391 | + echo '</span>' . $right_separator; | |
| 9392 | + echo '</li>'; | |
| 9393 | + } | |
| 9394 | + echo '</ul>'; | |
| 9395 | + } | |
| 9396 | + } | |
| 9397 | + | |
| 9398 | + echo '</ul>'; | |
| 9399 | + } | |
| 9400 | + | |
| 9401 | + public function get_hidden_filter_class($slug, $settings) | |
| 9402 | + { | |
| 9403 | + // Query posts & see if the category is used | |
| 9404 | + $posts = new WP_Query($this->get_main_query_args()); | |
| 9405 | + $visible_slugs = []; | |
| 9406 | + | |
| 9407 | + if ($posts->have_posts()) { | |
| 9408 | + while ($posts->have_posts()) { | |
| 9409 | + $posts->the_post(); | |
| 9410 | + $cats = get_the_category(); | |
| 9411 | + foreach ($cats as $c) { | |
| 9412 | + $visible_slugs[] = $c->slug; | |
| 9413 | + } | |
| 9414 | + } | |
| 9415 | + $visible_slugs = array_unique($visible_slugs); | |
| 9416 | + wp_reset_postdata(); | |
| 9417 | + } | |
| 9418 | + | |
| 9419 | + return (!in_array($slug, $visible_slugs) && 'yes' === $settings['filters_hide_empty']) | |
| 9420 | + ? ' king-addons-hidden-element' | |
| 9421 | + : ''; | |
| 9422 | + } | |
| 9423 | + | |
| 9424 | + public function render_grid_pagination($settings) | |
| 9425 | + { | |
| 9426 | + // Bail if pagination off, or only one page, or in slider mode | |
| 9427 | + if ( | |
| 9428 | + 'yes' !== $settings['layout_pagination'] || | |
| 9429 | + 1 === $this->get_max_num_pages() || | |
| 9430 | + 'slider' === $settings['layout_select'] | |
| 9431 | + ) { | |
| 9432 | + return; | |
| 9433 | + } | |
| 9434 | + | |
| 9435 | + global $paged; | |
| 9436 | + $pages = $this->get_max_num_pages(); | |
| 9437 | + | |
| 9438 | + $paged = get_query_var('paged') ?: (get_query_var('page') ?: 1); | |
| 9439 | + | |
| 9440 | + // Ensure no premium pagination type if not premium | |
| 9441 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 9442 | + if ('pro-is' === $settings['pagination_type']) { | |
| 9443 | + $settings['pagination_type'] = 'default'; | |
| 9444 | + } | |
| 9445 | + } | |
| 9446 | + | |
| 9447 | + echo '<div class="king-addons-grid-pagination elementor-clearfix king-addons-grid-pagination-' . esc_attr($settings['pagination_type']) . '">'; | |
| 9448 | + | |
| 9449 | + // 1) Default older/newer | |
| 9450 | + if ('default' === $settings['pagination_type']) { | |
| 9451 | + if ($paged < $pages) { | |
| 9452 | + echo '<a href="' . esc_url(get_pagenum_link($paged + 1)) . '" class="king-addons-prev-post-link">'; | |
| 9453 | + echo Core::getIcon($settings['pagination_on_icon'], 'left'); | |
| 9454 | + echo esc_html($settings['pagination_older_text']); | |
| 9455 | + echo '</a>'; | |
| 9456 | + } elseif ('yes' === $settings['pagination_disabled_arrows']) { | |
| 9457 | + echo '<span class="king-addons-prev-post-link king-addons-disabled-arrow">'; | |
| 9458 | + echo Core::getIcon($settings['pagination_on_icon'], 'left'); | |
| 9459 | + echo esc_html($settings['pagination_older_text']); | |
| 9460 | + echo '</span>'; | |
| 9461 | + } | |
| 9462 | + | |
| 9463 | + if ($paged > 1) { | |
| 9464 | + echo '<a href="' . esc_url(get_pagenum_link($paged - 1)) . '" class="king-addons-next-post-link">'; | |
| 9465 | + echo esc_html($settings['pagination_newer_text']); | |
| 9466 | + echo Core::getIcon($settings['pagination_on_icon'], 'right'); | |
| 9467 | + echo '</a>'; | |
| 9468 | + } elseif ('yes' === $settings['pagination_disabled_arrows']) { | |
| 9469 | + echo '<span class="king-addons-next-post-link king-addons-disabled-arrow">'; | |
| 9470 | + echo esc_html($settings['pagination_newer_text']); | |
| 9471 | + echo Core::getIcon($settings['pagination_on_icon'], 'right'); | |
| 9472 | + echo '</span>'; | |
| 9473 | + } | |
| 9474 | + | |
| 9475 | + // 2) Numbered pagination | |
| 9476 | + } elseif ('numbered' === $settings['pagination_type']) { | |
| 9477 | + $range = $settings['pagination_range']; | |
| 9478 | + $showitems = ($range * 2) + 1; | |
| 9479 | + | |
| 9480 | + if (1 !== $pages) { | |
| 9481 | + // Prev / First arrows if needed | |
| 9482 | + if ('yes' === $settings['pagination_prev_next'] || 'yes' === $settings['pagination_first_last']) { | |
| 9483 | + echo '<div class="king-addons-grid-pagination-left-arrows">'; | |
| 9484 | + if ('yes' === $settings['pagination_first_last']) { | |
| 9485 | + if ($paged >= 2) { | |
| 9486 | + echo '<a href="' . esc_url(get_pagenum_link()) . '" class="king-addons-first-page">'; | |
| 9487 | + echo Core::getIcon($settings['pagination_fl_icon'], 'left'); | |
| 9488 | + echo '<span>' . esc_html($settings['pagination_first_text']) . '</span>'; | |
| 9489 | + echo '</a>'; | |
| 9490 | + } elseif ('yes' === $settings['pagination_disabled_arrows']) { | |
| 9491 | + echo '<span class="king-addons-first-page king-addons-disabled-arrow">'; | |
| 9492 | + echo Core::getIcon($settings['pagination_fl_icon'], 'left'); | |
| 9493 | + echo '<span>' . esc_html($settings['pagination_first_text']) . '</span>'; | |
| 9494 | + echo '</span>'; | |
| 9495 | + } | |
| 9496 | + } | |
| 9497 | + if ('yes' === $settings['pagination_prev_next']) { | |
| 9498 | + if ($paged > 1) { | |
| 9499 | + echo '<a href="' . esc_url(get_pagenum_link($paged - 1)) . '" class="king-addons-prev-page">'; | |
| 9500 | + echo Core::getIcon($settings['pagination_pn_icon'], 'left'); | |
| 9501 | + echo '<span>' . esc_html($settings['pagination_prev_text']) . '</span>'; | |
| 9502 | + echo '</a>'; | |
| 9503 | + } elseif ('yes' === $settings['pagination_disabled_arrows']) { | |
| 9504 | + echo '<span class="king-addons-prev-page king-addons-disabled-arrow">'; | |
| 9505 | + echo Core::getIcon($settings['pagination_pn_icon'], 'left'); | |
| 9506 | + echo '<span>' . esc_html($settings['pagination_prev_text']) . '</span>'; | |
| 9507 | + echo '</span>'; | |
| 9508 | + } | |
| 9509 | + } | |
| 9510 | + echo '</div>'; | |
| 9511 | + } | |
| 9512 | + | |
| 9513 | + // Loop through pages | |
| 9514 | + for ($i = 1; $i <= $pages; $i++) { | |
| 9515 | + if (1 !== $pages && ( | |
| 9516 | + !($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || | |
| 9517 | + $pages <= $showitems | |
| 9518 | + )) { | |
| 9519 | + if ($paged === $i) { | |
| 9520 | + echo '<span class="king-addons-grid-current-page">' . esc_html($i) . '</span>'; | |
| 9521 | + } else { | |
| 9522 | + echo '<a href="' . esc_url(get_pagenum_link($i)) . '">' . esc_html($i) . '</a>'; | |
| 9523 | + } | |
| 9524 | + } | |
| 9525 | + } | |
| 9526 | + | |
| 9527 | + // Next / Last arrows if needed | |
| 9528 | + if ('yes' === $settings['pagination_prev_next'] || 'yes' === $settings['pagination_first_last']) { | |
| 9529 | + echo '<div class="king-addons-grid-pagination-right-arrows">'; | |
| 9530 | + if ('yes' === $settings['pagination_prev_next']) { | |
| 9531 | + if ($paged < $pages) { | |
| 9532 | + echo '<a href="' . esc_url(get_pagenum_link($paged + 1)) . '" class="king-addons-next-page">'; | |
| 9533 | + echo '<span>' . esc_html($settings['pagination_next_text']) . '</span>'; | |
| 9534 | + echo Core::getIcon($settings['pagination_pn_icon'], 'right'); | |
| 9535 | + echo '</a>'; | |
| 9536 | + } elseif ('yes' === $settings['pagination_disabled_arrows']) { | |
| 9537 | + echo '<span class="king-addons-next-page king-addons-disabled-arrow">'; | |
| 9538 | + echo '<span>' . esc_html($settings['pagination_next_text']) . '</span>'; | |
| 9539 | + echo Core::getIcon($settings['pagination_pn_icon'], 'right'); | |
| 9540 | + echo '</span>'; | |
| 9541 | + } | |
| 9542 | + } | |
| 9543 | + if ('yes' === $settings['pagination_first_last']) { | |
| 9544 | + if ($paged <= $pages - 1) { | |
| 9545 | + echo '<a href="' . esc_url(get_pagenum_link($pages)) . '" class="king-addons-last-page">'; | |
| 9546 | + echo '<span>' . esc_html($settings['pagination_last_text']) . '</span>'; | |
| 9547 | + echo Core::getIcon($settings['pagination_fl_icon'], 'right'); | |
| 9548 | + echo '</a>'; | |
| 9549 | + } elseif ('yes' === $settings['pagination_disabled_arrows']) { | |
| 9550 | + echo '<span class="king-addons-last-page king-addons-disabled-arrow">'; | |
| 9551 | + echo '<span>' . esc_html($settings['pagination_last_text']) . '</span>'; | |
| 9552 | + echo Core::getIcon($settings['pagination_fl_icon'], 'right'); | |
| 9553 | + echo '</span>'; | |
| 9554 | + } | |
| 9555 | + } | |
| 9556 | + echo '</div>'; | |
| 9557 | + } | |
| 9558 | + } | |
| 9559 | + | |
| 9560 | + // 3) "Load More" infinite style | |
| 9561 | + } else { | |
| 9562 | + echo '<a href="' . esc_url(get_pagenum_link($paged + 1)) . '" class="king-addons-load-more-btn" data-e-disable-page-transition>'; | |
| 9563 | + echo esc_html($settings['pagination_load_more_text']); | |
| 9564 | + echo '</a>'; | |
| 9565 | + | |
| 9566 | + echo '<div class="king-addons-pagination-loading">'; | |
| 9567 | + switch ($settings['pagination_animation']) { | |
| 9568 | + case 'loader-1': | |
| 9569 | + echo '<div class="king-addons-double-bounce">'; | |
| 9570 | + echo ' <div class="king-addons-child king-addons-double-bounce1"></div>'; | |
| 9571 | + echo ' <div class="king-addons-child king-addons-double-bounce2"></div>'; | |
| 9572 | + echo '</div>'; | |
| 9573 | + break; | |
| 9574 | + case 'loader-2': | |
| 9575 | + echo '<div class="king-addons-wave">'; | |
| 9576 | + echo ' <div class="king-addons-rect king-addons-rect1"></div>'; | |
| 9577 | + echo ' <div class="king-addons-rect king-addons-rect2"></div>'; | |
| 9578 | + echo ' <div class="king-addons-rect king-addons-rect3"></div>'; | |
| 9579 | + echo ' <div class="king-addons-rect king-addons-rect4"></div>'; | |
| 9580 | + echo ' <div class="king-addons-rect king-addons-rect5"></div>'; | |
| 9581 | + echo '</div>'; | |
| 9582 | + break; | |
| 9583 | + case 'loader-3': | |
| 9584 | + echo '<div class="king-addons-spinner king-addons-spinner-pulse"></div>'; | |
| 9585 | + break; | |
| 9586 | + case 'loader-4': | |
| 9587 | + echo '<div class="king-addons-chasing-dots">'; | |
| 9588 | + echo ' <div class="king-addons-child king-addons-dot1"></div>'; | |
| 9589 | + echo ' <div class="king-addons-child king-addons-dot2"></div>'; | |
| 9590 | + echo '</div>'; | |
| 9591 | + break; | |
| 9592 | + case 'loader-5': | |
| 9593 | + echo '<div class="king-addons-three-bounce">'; | |
| 9594 | + echo ' <div class="king-addons-child king-addons-bounce1"></div>'; | |
| 9595 | + echo ' <div class="king-addons-child king-addons-bounce2"></div>'; | |
| 9596 | + echo ' <div class="king-addons-child king-addons-bounce3"></div>'; | |
| 9597 | + echo '</div>'; | |
| 9598 | + break; | |
| 9599 | + case 'loader-6': | |
| 9600 | + echo '<div class="king-addons-fading-circle">'; | |
| 9601 | + for ($i = 1; $i <= 12; $i++) { | |
| 9602 | + echo '<div class="king-addons-circle king-addons-circle' . $i . '"></div>'; | |
| 9603 | + } | |
| 9604 | + echo '</div>'; | |
| 9605 | + break; | |
| 9606 | + default: | |
| 9607 | + break; | |
| 9608 | + } | |
| 9609 | + echo '</div>'; | |
| 9610 | + | |
| 9611 | + echo '<p class="king-addons-pagination-finish">' . esc_html($settings['pagination_finish_text']) . '</p>'; | |
| 9612 | + } | |
| 9613 | + | |
| 9614 | + echo '</div>'; | |
| 9615 | + } | |
| 9616 | + | |
| 9617 | + public function add_grid_settings($settings) | |
| 9618 | + { | |
| 9619 | + // Prevent undefined index notices for lightbox popup settings. | |
| 9620 | + $settings = wp_parse_args( | |
| 9621 | + $settings, | |
| 9622 | + [ | |
| 9623 | + 'lightbox_popup_autoplay' => 'true', | |
| 9624 | + 'lightbox_popup_pause' => 5, | |
| 9625 | + 'lightbox_popup_progressbar' => 'true', | |
| 9626 | + 'lightbox_popup_counter' => 'true', | |
| 9627 | + 'lightbox_popup_arrows' => 'true', | |
| 9628 | + 'lightbox_popup_captions' => 'true', | |
| 9629 | + 'lightbox_popup_thumbnails' => '', | |
| 9630 | + 'lightbox_popup_thumbnails_default' => '', | |
| 9631 | + 'lightbox_popup_sharing' => '', | |
| 9632 | + 'lightbox_popup_zoom' => 'true', | |
| 9633 | + 'lightbox_popup_fullscreen' => 'true', | |
| 9634 | + 'lightbox_popup_download' => 'true', | |
| 9635 | + ] | |
| 9636 | + ); | |
| 9637 | + | |
| 9638 | + // If premium not available, fallback | |
| 9639 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 9640 | + if ('pro-ms' === $settings['layout_select']) { | |
| 9641 | + $settings['layout_select'] = 'fitRows'; | |
| 9642 | + } | |
| 9643 | + $settings['filters_deeplinking'] = ''; | |
| 9644 | + $settings['filters_count'] = ''; | |
| 9645 | + $settings['filters_default_filter'] = ''; | |
| 9646 | + if (in_array($settings['filters_animation'], ['pro-fd', 'pro-fs'])) { | |
| 9647 | + $settings['filters_animation'] = 'zoom'; | |
| 9648 | + } | |
| 9649 | + } | |
| 9650 | + | |
| 9651 | + // Only allow "stick_last_element_to_bottom" if layout_select == fitRows | |
| 9652 | + $stick_last_element = ('fitRows' === $settings['layout_select']) | |
| 9653 | + ? $settings['stick_last_element_to_bottom'] | |
| 9654 | + : 'no'; | |
| 9655 | + | |
| 9656 | + // Prepare gutter sizes | |
| 9657 | + $gutter_hr_widescreen = $settings['layout_gutter_hr_widescreen']['size'] ?? $settings['layout_gutter_hr']['size']; | |
| 9658 | + $gutter_hr_desktop = $settings['layout_gutter_hr']['size'] ?? 0; | |
| 9659 | + $gutter_hr_laptop = $settings['layout_gutter_hr_laptop']['size'] ?? $gutter_hr_desktop; | |
| 9660 | + $gutter_hr_tablet_ex = $settings['layout_gutter_hr_tablet_extra']['size'] ?? $gutter_hr_laptop; | |
| 9661 | + $gutter_hr_tablet = $settings['layout_gutter_hr_tablet']['size'] ?? $gutter_hr_tablet_ex; | |
| 9662 | + $gutter_hr_mobile_ex = $settings['layout_gutter_hr_mobile_extra']['size'] ?? $gutter_hr_tablet; | |
| 9663 | + $gutter_hr_mobile = $settings['layout_gutter_hr_mobile']['size'] ?? $gutter_hr_mobile_ex; | |
| 9664 | + $gutter_vr_widescreen = $settings['layout_gutter_vr_widescreen']['size'] ?? $settings['layout_gutter_vr']['size']; | |
| 9665 | + $gutter_vr_desktop = $settings['layout_gutter_vr']['size'] ?? 0; | |
| 9666 | + $gutter_vr_laptop = $settings['layout_gutter_vr_laptop']['size'] ?? $gutter_vr_desktop; | |
| 9667 | + $gutter_vr_tablet_ex = $settings['layout_gutter_vr_tablet_extra']['size'] ?? $gutter_vr_laptop; | |
| 9668 | + $gutter_vr_tablet = $settings['layout_gutter_vr_tablet']['size'] ?? $gutter_vr_tablet_ex; | |
| 9669 | + $gutter_vr_mobile_ex = $settings['layout_gutter_vr_mobile_extra']['size'] ?? $gutter_vr_tablet; | |
| 9670 | + $gutter_vr_mobile = $settings['layout_gutter_vr_mobile']['size'] ?? $gutter_vr_mobile_ex; | |
| 9671 | + | |
| 9672 | + $layout_settings = [ | |
| 9673 | + 'layout' => $settings['layout_select'], | |
| 9674 | + 'stick_last_element_to_bottom' => $stick_last_element, | |
| 9675 | + 'columns_desktop' => $settings['layout_columns'], | |
| 9676 | + 'gutter_hr' => $gutter_hr_desktop, | |
| 9677 | + 'gutter_hr_mobile' => $gutter_hr_mobile, | |
| 9678 | + 'gutter_hr_mobile_extra' => $gutter_hr_mobile_ex, | |
| 9679 | + 'gutter_hr_tablet' => $gutter_hr_tablet, | |
| 9680 | + 'gutter_hr_tablet_extra' => $gutter_hr_tablet_ex, | |
| 9681 | + 'gutter_hr_laptop' => $gutter_hr_laptop, | |
| 9682 | + 'gutter_hr_widescreen' => $gutter_hr_widescreen, | |
| 9683 | + 'gutter_vr' => $gutter_vr_desktop, | |
| 9684 | + 'gutter_vr_mobile' => $gutter_vr_mobile, | |
| 9685 | + 'gutter_vr_mobile_extra' => $gutter_vr_mobile_ex, | |
| 9686 | + 'gutter_vr_tablet' => $gutter_vr_tablet, | |
| 9687 | + 'gutter_vr_tablet_extra' => $gutter_vr_tablet_ex, | |
| 9688 | + 'gutter_vr_laptop' => $gutter_vr_laptop, | |
| 9689 | + 'gutter_vr_widescreen' => $gutter_vr_widescreen, | |
| 9690 | + 'animation' => $settings['layout_animation'], | |
| 9691 | + 'animation_duration' => $settings['layout_animation_duration'], | |
| 9692 | + 'animation_delay' => $settings['layout_animation_delay'], | |
| 9693 | + 'deeplinking' => $settings['filters_deeplinking'], | |
| 9694 | + 'filters_linkable' => $settings['filters_linkable'], | |
| 9695 | + 'filters_default_filter' => $settings['filters_default_filter'], | |
| 9696 | + 'filters_count' => $settings['filters_count'], | |
| 9697 | + 'filters_hide_empty' => $settings['filters_hide_empty'], | |
| 9698 | + 'filters_animation' => $settings['filters_animation'], | |
| 9699 | + 'filters_animation_duration' => $settings['filters_animation_duration'], | |
| 9700 | + 'filters_animation_delay' => $settings['filters_animation_delay'], | |
| 9701 | + 'pagination_type' => $settings['pagination_type'], | |
| 9702 | + 'pagination_max_pages' => $this->get_max_num_pages(), | |
| 9703 | + ]; | |
| 9704 | + | |
| 9705 | + if ('list' === $settings['layout_select']) { | |
| 9706 | + $layout_settings['media_align'] = $settings['layout_list_align']; | |
| 9707 | + $layout_settings['media_width'] = $settings['layout_list_media_width']['size']; | |
| 9708 | + $layout_settings['media_distance'] = $settings['layout_list_media_distance']['size']; | |
| 9709 | + } | |
| 9710 | + | |
| 9711 | + // Restrict pop-up if not premium | |
| 9712 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 9713 | + $settings['lightbox_popup_thumbnails'] = ''; | |
| 9714 | + $settings['lightbox_popup_thumbnails_default'] = ''; | |
| 9715 | + $settings['lightbox_popup_sharing'] = ''; | |
| 9716 | + } | |
| 9717 | + | |
| 9718 | + // Lightbox config | |
| 9719 | + $layout_settings['lightbox'] = [ | |
| 9720 | + 'selector' => '.king-addons-grid-image-wrap', | |
| 9721 | + 'iframeMaxWidth' => '60%', | |
| 9722 | + 'hash' => false, | |
| 9723 | + 'autoplay' => $settings['lightbox_popup_autoplay'], | |
| 9724 | + 'pause' => $settings['lightbox_popup_pause'] * 1000, | |
| 9725 | + 'progressBar' => $settings['lightbox_popup_progressbar'], | |
| 9726 | + 'counter' => $settings['lightbox_popup_counter'], | |
| 9727 | + 'controls' => $settings['lightbox_popup_arrows'], | |
| 9728 | + 'getCaptionFromTitleOrAlt' => false, | |
| 9729 | + 'thumbnail' => $settings['lightbox_popup_thumbnails'], | |
| 9730 | + 'showThumbByDefault' => $settings['lightbox_popup_thumbnails_default'], | |
| 9731 | + 'share' => $settings['lightbox_popup_sharing'], | |
| 9732 | + 'zoom' => $settings['lightbox_popup_zoom'], | |
| 9733 | + 'fullScreen' => $settings['lightbox_popup_fullscreen'], | |
| 9734 | + 'download' => $settings['lightbox_popup_download'], | |
| 9735 | + ]; | |
| 9736 | + | |
| 9737 | + if ('yes' === ($settings['filters_experiment'] ?? '')) { | |
| 9738 | + // Potentially store entire $settings if needed | |
| 9739 | + $layout_settings['grid_settings'] = $settings; | |
| 9740 | + } | |
| 9741 | + | |
| 9742 | + $this->add_render_attribute('grid-settings', [ | |
| 9743 | + 'data-settings' => wp_json_encode($layout_settings), | |
| 9744 | + ]); | |
| 9745 | + } | |
| 9746 | + | |
| 9747 | + public function add_slider_settings($settings) | |
| 9748 | + { | |
| 9749 | + // Prevent undefined index notices for lightbox popup settings. | |
| 9750 | + $settings = wp_parse_args( | |
| 9751 | + $settings, | |
| 9752 | + [ | |
| 9753 | + 'lightbox_popup_autoplay' => 'true', | |
| 9754 | + 'lightbox_popup_pause' => 5, | |
| 9755 | + 'lightbox_popup_progressbar' => 'true', | |
| 9756 | + 'lightbox_popup_counter' => 'true', | |
| 9757 | + 'lightbox_popup_arrows' => 'true', | |
| 9758 | + 'lightbox_popup_captions' => 'true', | |
| 9759 | + 'lightbox_popup_thumbnails' => '', | |
| 9760 | + 'lightbox_popup_thumbnails_default' => '', | |
| 9761 | + 'lightbox_popup_sharing' => '', | |
| 9762 | + 'lightbox_popup_zoom' => 'true', | |
| 9763 | + 'lightbox_popup_fullscreen' => 'true', | |
| 9764 | + 'lightbox_popup_download' => 'true', | |
| 9765 | + ] | |
| 9766 | + ); | |
| 9767 | + | |
| 9768 | + $slider_is_rtl = is_rtl(); | |
| 9769 | + $slider_dir = $slider_is_rtl ? 'rtl' : 'ltr'; | |
| 9770 | + | |
| 9771 | + // Fall back for non-premium | |
| 9772 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 9773 | + $settings['layout_slider_autoplay'] = ''; | |
| 9774 | + $settings['layout_slider_autoplay_duration'] = 0; | |
| 9775 | + $settings['layout_slider_pause_on_hover'] = ''; | |
| 9776 | + } | |
| 9777 | + | |
| 9778 | + if (in_array($settings['layout_slider_amount'], ['pro-3', 'pro-4', 'pro-5', 'pro-6'])) { | |
| 9779 | + $settings['layout_slider_amount'] = 1; // fallback | |
| 9780 | + } | |
| 9781 | + | |
| 9782 | + $slider_options = [ | |
| 9783 | + 'rtl' => $slider_is_rtl, | |
| 9784 | + 'infinite' => ('yes' === $settings['layout_slider_loop']), | |
| 9785 | + 'speed' => absint($settings['layout_slider_effect_duration'] * 1000), | |
| 9786 | + 'arrows' => true, | |
| 9787 | + 'dots' => true, | |
| 9788 | + 'autoplay' => ('yes' === $settings['layout_slider_autoplay']), | |
| 9789 | + 'autoplaySpeed' => absint($settings['layout_slider_autoplay_duration'] * 1000), | |
| 9790 | + 'pauseOnHover' => $settings['layout_slider_pause_on_hover'], | |
| 9791 | + 'prevArrow' => '#king-addons-grid-slider-prev-' . $this->get_id(), | |
| 9792 | + 'nextArrow' => '#king-addons-grid-slider-next-' . $this->get_id(), | |
| 9793 | + 'sliderSlidesToScroll' => $settings['layout_slides_to_scroll'] ? absint($settings['layout_slides_to_scroll']) : 1, | |
| 9794 | + ]; | |
| 9795 | + | |
| 9796 | + // Restrict pop-up for non-premium | |
| 9797 | + if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 9798 | + $settings['lightbox_popup_thumbnails'] = ''; | |
| 9799 | + $settings['lightbox_popup_thumbnails_default'] = ''; | |
| 9800 | + $settings['lightbox_popup_sharing'] = ''; | |
| 9801 | + } | |
| 9802 | + | |
| 9803 | + // Lightbox config | |
| 9804 | + $slider_options['lightbox'] = [ | |
| 9805 | + 'selector' => 'article:not(.slick-cloned) .king-addons-grid-image-wrap', | |
| 9806 | + 'iframeMaxWidth' => '60%', | |
| 9807 | + 'hash' => false, | |
| 9808 | + 'autoplay' => $settings['lightbox_popup_autoplay'], | |
| 9809 | + 'pause' => $settings['lightbox_popup_pause'] * 1000, | |
| 9810 | + 'progressBar' => $settings['lightbox_popup_progressbar'], | |
| 9811 | + 'counter' => $settings['lightbox_popup_counter'], | |
| 9812 | + 'controls' => $settings['lightbox_popup_arrows'], | |
| 9813 | + 'getCaptionFromTitleOrAlt' => false, | |
| 9814 | + 'thumbnail' => $settings['lightbox_popup_thumbnails'], | |
| 9815 | + 'showThumbByDefault' => $settings['lightbox_popup_thumbnails_default'], | |
| 9816 | + 'share' => $settings['lightbox_popup_sharing'], | |
| 9817 | + 'zoom' => $settings['lightbox_popup_zoom'], | |
| 9818 | + 'fullScreen' => $settings['lightbox_popup_fullscreen'], | |
| 9819 | + 'download' => $settings['lightbox_popup_download'], | |
| 9820 | + ]; | |
| 9821 | + | |
| 9822 | + // Enable fade effect for single-slide | |
| 9823 | + if ($settings['layout_slider_amount'] === 1 && $settings['layout_slider_effect'] === 'fade') { | |
| 9824 | + $slider_options['fade'] = true; | |
| 9825 | + } | |
| 9826 | + | |
| 9827 | + $this->add_render_attribute('slider-settings', [ | |
| 9828 | + 'dir' => esc_attr($slider_dir), | |
| 9829 | + 'data-slick' => wp_json_encode($slider_options), | |
| 9830 | + ]); | |
| 9831 | + } | |
| 9832 | + | |
| 9833 | + protected function render() | |
| 9834 | + { | |
| 9835 | + $settings = Core::displaySettings($this); | |
| 9836 | + $posts = new WP_Query($this->get_main_query_args()); | |
| 9837 | + | |
| 9838 | + if ($posts->have_posts()) { | |
| 9839 | + // Render filters if not slider | |
| 9840 | + if ('slider' !== $settings['layout_select']) { | |
| 9841 | + $this->render_grid_filters($settings); | |
| 9842 | + $this->add_grid_settings($settings); | |
| 9843 | + $render_attribute = $this->get_render_attribute_string('grid-settings'); | |
| 9844 | + } else { | |
| 9845 | + // If slider | |
| 9846 | + $this->add_slider_settings($settings); | |
| 9847 | + $render_attribute = $this->get_render_attribute_string('slider-settings'); | |
| 9848 | + } | |
| 9849 | + | |
| 9850 | + echo '<section class="king-addons-grid elementor-clearfix" ' . $render_attribute . '>'; | |
| 9851 | + | |
| 9852 | + while ($posts->have_posts()) { | |
| 9853 | + $posts->the_post(); | |
| 9854 | + $post_class = implode(' ', get_post_class('king-addons-grid-item elementor-clearfix', get_the_ID())); | |
| 9855 | + | |
| 9856 | + echo '<article class="' . esc_attr($post_class) . '">'; | |
| 9857 | + // Check password | |
| 9858 | + $this->render_password_protected_input(); | |
| 9859 | + | |
| 9860 | + echo '<div class="king-addons-grid-item-inner">'; | |
| 9861 | + // Location: ABOVE | |
| 9862 | + $this->get_elements_by_location('above', $settings, get_the_ID()); | |
| 9863 | + | |
| 9864 | + // If has featured image, render | |
| 9865 | + if ('yes' !== $settings['hide_post_thumbnail']) { | |
| 9866 | + echo '<div class="king-addons-grid-media-wrap' . esc_attr($this->get_image_effect_class($settings)) . '" data-overlay-link="' . esc_attr($settings['overlay_post_link']) . '">'; | |
| 9867 | + $this->render_post_thumbnail($settings); | |
| 9868 | + | |
| 9869 | + echo '<div class="king-addons-grid-media-hover king-addons-animation-wrap">'; | |
| 9870 | + $this->render_media_overlay($settings); | |
| 9871 | + $this->get_elements_by_location('over', $settings, get_the_ID()); | |
| 9872 | + echo '</div>'; | |
| 9873 | + | |
| 9874 | + echo '</div>'; | |
| 9875 | + } | |
| 9876 | + | |
| 9877 | + // Location: BELOW | |
| 9878 | + $this->get_elements_by_location('below', $settings, get_the_ID()); | |
| 9879 | + echo '</div>'; | |
| 9880 | + | |
| 9881 | + echo '</article>'; | |
| 9882 | + } | |
| 9883 | + echo '</section>'; | |
| 9884 | + | |
| 9885 | + // Reset | |
| 9886 | + wp_reset_postdata(); | |
| 9887 | + | |
| 9888 | + // If slider, render nav | |
| 9889 | + if ('slider' === $settings['layout_select']) { | |
| 9890 | + echo '<div class="king-addons-grid-slider-arrow-container">'; | |
| 9891 | + echo ' <div class="king-addons-grid-slider-prev-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-prev-' . esc_attr($this->get_id()) . '">' . Core::getIcon($settings['layout_slider_nav_icon'], '') . '</div>'; | |
| 9892 | + echo ' <div class="king-addons-grid-slider-next-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-next-' . esc_attr($this->get_id()) . '">' . Core::getIcon($settings['layout_slider_nav_icon'], '') . '</div>'; | |
| 9893 | + echo '</div>'; | |
| 9894 | + | |
| 9895 | + echo '<div class="king-addons-grid-slider-dots"></div>'; | |
| 9896 | + } | |
| 9897 | + | |
| 9898 | + // Render pagination if needed | |
| 9899 | + $this->render_grid_pagination($settings); | |
| 9900 | + } else { | |
| 9901 | + // If no posts found | |
| 9902 | + if ('dynamic' === $settings['query_selection']) { | |
| 9903 | + echo '<h2>' . esc_html($settings['query_not_found_text']) . '</h2>'; | |
| 9904 | + } | |
| 9905 | + } | |
| 9906 | + } | |
| 9907 | +} | |