Adv_Accordion.php
4 years ago
Adv_Tabs.php
4 years ago
Advanced_Data_Table.php
4 years ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
4 years ago
Betterdocs_Category_Grid.php
4 years ago
Betterdocs_Search_Form.php
4 years ago
Caldera_Forms.php
4 years ago
Career_Page.php
4 years ago
Contact_Form_7.php
4 years ago
Content_Ticker.php
4 years ago
Countdown.php
4 years ago
Creative_Button.php
4 years ago
Crowdfundly_All_Campaign.php
4 years ago
Crowdfundly_Organization.php
4 years ago
Crowdfundly_Single_Campaign.php
4 years ago
Cta_Box.php
4 years ago
Data_Table.php
4 years ago
Dual_Color_Header.php
4 years ago
EmbedPress.php
4 years ago
Event_Calendar.php
4 years ago
Facebook_Feed.php
4 years ago
Fancy_Text.php
4 years ago
Feature_List.php
4 years ago
Filterable_Gallery.php
4 years ago
Flip_Box.php
4 years ago
FluentForm.php
4 years ago
Formstack.php
4 years ago
GravityForms.php
4 years ago
Image_Accordion.php
4 years ago
Info_Box.php
4 years ago
Interactive_Circle.php
4 years ago
Login_Register.php
4 years ago
NinjaForms.php
4 years ago
Post_Grid.php
4 years ago
Post_Timeline.php
4 years ago
Pricing_Table.php
4 years ago
Product_Grid.php
4 years ago
Progress_Bar.php
4 years ago
Simple_Menu.php
4 years ago
Sticky_Video.php
4 years ago
Team_Member.php
4 years ago
Testimonial.php
4 years ago
Tooltip.php
4 years ago
Twitter_Feed.php
4 years ago
TypeForm.php
4 years ago
WeForms.php
4 years ago
Woo_Cart.php
4 years ago
Woo_Checkout.php
4 years ago
Woo_Product_Carousel.php
4 years ago
Woo_Product_Compare.php
4 years ago
Woo_Product_Gallery.php
4 years ago
Woocommerce_Review.php
4 years ago
WpForms.php
4 years ago
Cta_Box.php
1543 lines
| 1 | <?php |
| 2 | namespace Essential_Addons_Elementor\Elements; |
| 3 | |
| 4 | // If this file is called directly, abort. |
| 5 | if (!defined('ABSPATH')) { |
| 6 | exit; |
| 7 | } |
| 8 | |
| 9 | use \Elementor\Controls_Manager; |
| 10 | use Elementor\Icons_Manager; |
| 11 | use \Elementor\Plugin; |
| 12 | use \Elementor\Group_Control_Border; |
| 13 | use \Elementor\Group_Control_Box_Shadow; |
| 14 | use \Elementor\Group_Control_Typography; |
| 15 | use \Elementor\Utils; |
| 16 | use Elementor\Modules\DynamicTags\Module as TagsModule; |
| 17 | use \Elementor\Widget_Base; |
| 18 | |
| 19 | use \Essential_Addons_Elementor\Classes\Helper; |
| 20 | |
| 21 | class Cta_Box extends Widget_Base |
| 22 | { |
| 23 | |
| 24 | |
| 25 | public function get_name() |
| 26 | { |
| 27 | return 'eael-cta-box'; |
| 28 | } |
| 29 | |
| 30 | public function get_title() |
| 31 | { |
| 32 | return esc_html__('Call to Action', 'essential-addons-for-elementor-lite'); |
| 33 | } |
| 34 | |
| 35 | public function get_icon() |
| 36 | { |
| 37 | return 'eaicon-call-to-action'; |
| 38 | } |
| 39 | |
| 40 | public function get_categories() |
| 41 | { |
| 42 | return ['essential-addons-elementor']; |
| 43 | } |
| 44 | |
| 45 | public function get_keywords() |
| 46 | { |
| 47 | return [ |
| 48 | 'call to action', |
| 49 | 'ea call to action', |
| 50 | 'cta', |
| 51 | 'ea cta', |
| 52 | 'button', |
| 53 | 'buy button', |
| 54 | 'action box', |
| 55 | 'ea', |
| 56 | 'essential addons' |
| 57 | ]; |
| 58 | } |
| 59 | |
| 60 | public function get_custom_help_url() { |
| 61 | return 'https://essential-addons.com/elementor/docs/call-to-action/'; |
| 62 | } |
| 63 | |
| 64 | protected function register_controls() |
| 65 | { |
| 66 | |
| 67 | /** |
| 68 | * Call to Action Content Settings |
| 69 | */ |
| 70 | $this->start_controls_section( |
| 71 | 'eael_section_cta_content_settings', |
| 72 | [ |
| 73 | 'label' => esc_html__('Content Settings', 'essential-addons-for-elementor-lite'), |
| 74 | ] |
| 75 | ); |
| 76 | |
| 77 | $this->add_control( |
| 78 | 'eael_cta_type', |
| 79 | [ |
| 80 | 'label' => esc_html__('Content Style', 'essential-addons-for-elementor-lite'), |
| 81 | 'type' => Controls_Manager::SELECT, |
| 82 | 'default' => 'cta-basic', |
| 83 | 'label_block' => false, |
| 84 | 'options' => [ |
| 85 | 'cta-basic' => esc_html__('Basic', 'essential-addons-for-elementor-lite'), |
| 86 | 'cta-flex' => esc_html__('Flex Grid', 'essential-addons-for-elementor-lite'), |
| 87 | 'cta-icon-flex' => esc_html__('Flex Grid with Icon', 'essential-addons-for-elementor-lite'), |
| 88 | ], |
| 89 | ] |
| 90 | ); |
| 91 | |
| 92 | $this->add_control( |
| 93 | 'eael_cta_preset', |
| 94 | [ |
| 95 | 'label' => esc_html__('Content Preset', 'essential-addons-for-elementor-lite'), |
| 96 | 'type' => Controls_Manager::SELECT, |
| 97 | 'default' => 'cta-preset-1', |
| 98 | 'label_block' => false, |
| 99 | 'options' => [ |
| 100 | 'cta-preset-1' => esc_html__('Preset 1', 'essential-addons-for-elementor-lite'), |
| 101 | 'cta-preset-2' => esc_html__('Preset 2', 'essential-addons-for-elementor-lite'), |
| 102 | ], |
| 103 | ] |
| 104 | ); |
| 105 | |
| 106 | /** |
| 107 | * Condition: 'eael_cta_type' => 'cta-basic' |
| 108 | */ |
| 109 | $this->add_responsive_control( |
| 110 | 'eael_cta_content_type', |
| 111 | [ |
| 112 | 'label' => esc_html__('Alignment', 'essential-addons-for-elementor-lite'), |
| 113 | 'type' => Controls_Manager::SELECT, |
| 114 | 'default' => 'cta-default', |
| 115 | 'label_block' => false, |
| 116 | 'options' => [ |
| 117 | 'cta-default' => esc_html__('Left', 'essential-addons-for-elementor-lite'), |
| 118 | 'cta-center' => esc_html__('Center', 'essential-addons-for-elementor-lite'), |
| 119 | 'cta-right' => esc_html__('Right', 'essential-addons-for-elementor-lite'), |
| 120 | ], |
| 121 | 'devices' => [ 'desktop', 'tablet', 'mobile' ], |
| 122 | 'prefix_class' => 'content-align-%s', |
| 123 | 'condition' => [ |
| 124 | 'eael_cta_type' => 'cta-basic', |
| 125 | ], |
| 126 | ] |
| 127 | ); |
| 128 | |
| 129 | $this->add_control( |
| 130 | 'eael_cta_color_type', |
| 131 | [ |
| 132 | 'label' => esc_html__('Color Style', 'essential-addons-for-elementor-lite'), |
| 133 | 'type' => Controls_Manager::SELECT, |
| 134 | 'default' => 'cta-bg-color', |
| 135 | 'label_block' => false, |
| 136 | 'options' => [ |
| 137 | 'cta-bg-color' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 138 | 'cta-bg-img' => esc_html__('Background Image', 'essential-addons-for-elementor-lite'), |
| 139 | 'cta-bg-img-fixed' => esc_html__('Background Fixed Image', 'essential-addons-for-elementor-lite'), |
| 140 | ], |
| 141 | ] |
| 142 | ); |
| 143 | |
| 144 | /** |
| 145 | * Condition: 'eael_cta_color_type' => 'cta-bg-img' && 'eael_cta_color_type' => 'cta-bg-img-fixed', |
| 146 | */ |
| 147 | $this->add_control( |
| 148 | 'eael_cta_bg_image', |
| 149 | [ |
| 150 | 'label' => esc_html__('Background Image', 'essential-addons-for-elementor-lite'), |
| 151 | 'type' => Controls_Manager::MEDIA, |
| 152 | 'default' => [ |
| 153 | 'url' => Utils::get_placeholder_image_src(), |
| 154 | ], |
| 155 | 'selectors' => [ |
| 156 | '{{WRAPPER}} .eael-call-to-action.bg-img' => 'background-image: url({{URL}});', |
| 157 | '{{WRAPPER}} .eael-call-to-action.bg-img-fixed' => 'background-image: url({{URL}});', |
| 158 | ], |
| 159 | 'condition' => [ |
| 160 | 'eael_cta_color_type' => ['cta-bg-img', 'cta-bg-img-fixed'], |
| 161 | ], |
| 162 | ] |
| 163 | ); |
| 164 | |
| 165 | $this->add_control( |
| 166 | 'eael_cta_bg_overlay', |
| 167 | [ |
| 168 | 'label' => __('Background Overlay', 'essential-addons-for-elementor-lite'), |
| 169 | 'type' => Controls_Manager::SWITCHER, |
| 170 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 171 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 172 | 'return_value' => 'yes', |
| 173 | 'default' => 'yes', |
| 174 | 'prefix_class' => 'eael-cta-overlay-', |
| 175 | 'condition' => [ |
| 176 | 'eael_cta_color_type!' => 'cta-bg-color', |
| 177 | ], |
| 178 | ] |
| 179 | ); |
| 180 | |
| 181 | /** |
| 182 | * Condition: 'eael_cta_type' => 'cta-icon-flex' |
| 183 | */ |
| 184 | $this->add_control( |
| 185 | 'eael_cta_flex_grid_icon_new', |
| 186 | [ |
| 187 | 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 188 | 'type' => Controls_Manager::ICONS, |
| 189 | 'fa4compatibility' => 'eael_cta_flex_grid_icon', |
| 190 | 'default' => [ |
| 191 | 'value' => 'fas fa-bullhorn', |
| 192 | 'library' => 'fa-solid', |
| 193 | ], |
| 194 | 'condition' => [ |
| 195 | 'eael_cta_type' => 'cta-icon-flex', |
| 196 | ], |
| 197 | ] |
| 198 | ); |
| 199 | |
| 200 | $this->add_control( |
| 201 | 'eael_cta_sub_title', |
| 202 | [ |
| 203 | 'label' => esc_html__('Sub Title', 'essential-addons-for-elementor-lite'), |
| 204 | 'type' => Controls_Manager::TEXT, |
| 205 | 'label_block' => true, |
| 206 | 'default' => '', |
| 207 | 'dynamic' => [ |
| 208 | 'active' => true, |
| 209 | 'categories' => [ |
| 210 | TagsModule::POST_META_CATEGORY, |
| 211 | TagsModule::TEXT_CATEGORY, |
| 212 | ], |
| 213 | ], |
| 214 | ] |
| 215 | ); |
| 216 | $this->add_control( |
| 217 | 'eael_cta_title', |
| 218 | [ |
| 219 | 'label' => esc_html__('Title', 'essential-addons-for-elementor-lite'), |
| 220 | 'type' => Controls_Manager::TEXT, |
| 221 | 'label_block' => true, |
| 222 | 'default' => esc_html__('Sample Call to Action Heading', 'essential-addons-for-elementor-lite'), |
| 223 | 'dynamic' => ['active' => true], |
| 224 | ] |
| 225 | ); |
| 226 | |
| 227 | $this->add_control( |
| 228 | 'title_tag', |
| 229 | [ |
| 230 | 'label' => __('Select Tag', 'essential-addons-for-elementor-lite'), |
| 231 | 'type' => Controls_Manager::SELECT, |
| 232 | 'default' => 'h2', |
| 233 | 'options' => [ |
| 234 | 'h1' => __('H1', 'essential-addons-for-elementor-lite'), |
| 235 | 'h2' => __('H2', 'essential-addons-for-elementor-lite'), |
| 236 | 'h3' => __('H3', 'essential-addons-for-elementor-lite'), |
| 237 | 'h4' => __('H4', 'essential-addons-for-elementor-lite'), |
| 238 | 'h5' => __('H5', 'essential-addons-for-elementor-lite'), |
| 239 | 'h6' => __('H6', 'essential-addons-for-elementor-lite'), |
| 240 | 'span' => __('Span', 'essential-addons-for-elementor-lite'), |
| 241 | 'p' => __('P', 'essential-addons-for-elementor-lite'), |
| 242 | 'div' => __('Div', 'essential-addons-for-elementor-lite'), |
| 243 | ], |
| 244 | ] |
| 245 | ); |
| 246 | |
| 247 | $this->add_control( |
| 248 | 'eael_cta_title_content_type', |
| 249 | [ |
| 250 | 'label' => __('Content Type', 'essential-addons-for-elementor-lite'), |
| 251 | 'type' => Controls_Manager::SELECT, |
| 252 | 'options' => [ |
| 253 | 'content' => __('Content', 'essential-addons-for-elementor-lite'), |
| 254 | 'template' => __('Saved Templates', 'essential-addons-for-elementor-lite'), |
| 255 | ], |
| 256 | 'default' => 'content', |
| 257 | ] |
| 258 | ); |
| 259 | |
| 260 | $this->add_control( |
| 261 | 'eael_primary_templates', |
| 262 | [ |
| 263 | 'label' => __('Choose Template', 'essential-addons-for-elementor-lite'), |
| 264 | 'type' => Controls_Manager::SELECT, |
| 265 | 'options' => Helper::get_elementor_templates(), |
| 266 | 'condition' => [ |
| 267 | 'eael_cta_title_content_type' => 'template', |
| 268 | ], |
| 269 | ] |
| 270 | ); |
| 271 | $this->add_control( |
| 272 | 'eael_cta_content', |
| 273 | [ |
| 274 | 'label' => esc_html__('Content', 'essential-addons-for-elementor-lite'), |
| 275 | 'type' => Controls_Manager::WYSIWYG, |
| 276 | 'label_block' => true, |
| 277 | 'default' => esc_html__('Add a strong one liner supporting the heading above and giving users a reason to click on the button below.', 'essential-addons-for-elementor-lite'), |
| 278 | 'separator' => 'after', |
| 279 | 'condition' => [ |
| 280 | 'eael_cta_title_content_type' => 'content', |
| 281 | ], |
| 282 | ] |
| 283 | ); |
| 284 | |
| 285 | // primary button |
| 286 | $this->add_control( |
| 287 | 'eael_cta_btn_preset', |
| 288 | [ |
| 289 | 'label' => esc_html__('Button Preset', 'essential-addons-for-elementor-lite'), |
| 290 | 'type' => Controls_Manager::SELECT, |
| 291 | 'default' => 'cta-btn-preset-2', |
| 292 | 'label_block' => false, |
| 293 | 'options' => [ |
| 294 | 'cta-btn-preset-1' => esc_html__('Preset 1', 'essential-addons-for-elementor-lite'), |
| 295 | 'cta-btn-preset-2' => esc_html__('Preset 2', 'essential-addons-for-elementor-lite'), |
| 296 | ], |
| 297 | 'condition' => [ |
| 298 | 'eael_cta_preset' => 'cta-preset-2', |
| 299 | ] |
| 300 | ] |
| 301 | ); |
| 302 | |
| 303 | $this->add_control( |
| 304 | 'eael_cta_btn_icon', |
| 305 | [ |
| 306 | 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 307 | 'type' => Controls_Manager::ICONS, |
| 308 | 'default' => [ |
| 309 | 'value' => 'fas fa-bullhorn', |
| 310 | 'library' => 'fa-solid', |
| 311 | ], |
| 312 | 'condition' => [ |
| 313 | 'eael_cta_preset' => 'cta-preset-2', |
| 314 | 'eael_cta_btn_preset' => 'cta-btn-preset-2', |
| 315 | ] |
| 316 | ] |
| 317 | ); |
| 318 | |
| 319 | |
| 320 | $this->add_control( |
| 321 | 'eael_cta_btn_text', |
| 322 | [ |
| 323 | 'label' => esc_html__('Primary Button Text', 'essential-addons-for-elementor-lite'), |
| 324 | 'type' => Controls_Manager::TEXT, |
| 325 | 'dynamic' => ['active' => true], |
| 326 | 'label_block' => true, |
| 327 | 'default' => esc_html__('Click Here', 'essential-addons-for-elementor-lite'), |
| 328 | ] |
| 329 | ); |
| 330 | |
| 331 | $this->add_control( |
| 332 | 'eael_cta_btn_link', |
| 333 | [ |
| 334 | 'label' => esc_html__('Primary Button Link', 'essential-addons-for-elementor-lite'), |
| 335 | 'type' => Controls_Manager::URL, |
| 336 | 'dynamic' => ['active' => true], |
| 337 | 'label_block' => true, |
| 338 | 'default' => [ |
| 339 | 'url' => 'http://', |
| 340 | 'is_external' => '', |
| 341 | ], |
| 342 | 'show_external' => true, |
| 343 | 'separator' => 'after', |
| 344 | ] |
| 345 | ); |
| 346 | |
| 347 | // secondary button |
| 348 | $this->add_control( |
| 349 | 'eael_cta_secondary_btn_is_show', |
| 350 | [ |
| 351 | 'label' => __( 'Show Secondary Button', 'essential-addons-for-elementor-lite' ), |
| 352 | 'type' => Controls_Manager::SWITCHER, |
| 353 | 'label_on' => __( 'Show', 'essential-addons-for-elementor-lite' ), |
| 354 | 'label_off' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 355 | 'return_value' => 'yes', |
| 356 | ] |
| 357 | ); |
| 358 | $this->add_control( |
| 359 | 'eael_cta_secondary_btn_text', |
| 360 | [ |
| 361 | 'label' => esc_html__('Secondary Button Text', 'essential-addons-for-elementor-lite'), |
| 362 | 'type' => Controls_Manager::TEXT, |
| 363 | 'dynamic' => ['active' => true], |
| 364 | 'label_block' => true, |
| 365 | 'default' => esc_html__('Click Now', 'essential-addons-for-elementor-lite'), |
| 366 | 'condition' => array( |
| 367 | 'eael_cta_secondary_btn_is_show' => 'yes' |
| 368 | ) |
| 369 | ] |
| 370 | ); |
| 371 | |
| 372 | $this->add_control( |
| 373 | 'eael_cta_secondary_btn_link', |
| 374 | [ |
| 375 | 'label' => esc_html__('Secondary Button Link', 'essential-addons-for-elementor-lite'), |
| 376 | 'type' => Controls_Manager::URL, |
| 377 | 'dynamic' => ['active' => true], |
| 378 | 'label_block' => true, |
| 379 | 'default' => [ |
| 380 | 'url' => 'http://', |
| 381 | 'is_external' => '', |
| 382 | ], |
| 383 | 'show_external' => true, |
| 384 | 'separator' => 'after', |
| 385 | 'condition' => array( |
| 386 | 'eael_cta_secondary_btn_is_show' => 'yes' |
| 387 | ) |
| 388 | ] |
| 389 | ); |
| 390 | |
| 391 | $this->end_controls_section(); |
| 392 | |
| 393 | if (!apply_filters('eael/pro_enabled', false)) { |
| 394 | $this->start_controls_section( |
| 395 | 'eael_section_pro', |
| 396 | [ |
| 397 | 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'), |
| 398 | ] |
| 399 | ); |
| 400 | |
| 401 | $this->add_control( |
| 402 | 'eael_control_get_pro', |
| 403 | [ |
| 404 | 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'), |
| 405 | 'type' => Controls_Manager::CHOOSE, |
| 406 | 'options' => [ |
| 407 | '1' => [ |
| 408 | 'title' => '', |
| 409 | 'icon' => 'fa fa-unlock-alt', |
| 410 | ], |
| 411 | ], |
| 412 | 'default' => '1', |
| 413 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>', |
| 414 | ] |
| 415 | ); |
| 416 | |
| 417 | $this->end_controls_section(); |
| 418 | } |
| 419 | |
| 420 | /** |
| 421 | * ------------------------------------------- |
| 422 | * Tab Style (Cta Title Style) |
| 423 | * ------------------------------------------- |
| 424 | */ |
| 425 | $this->start_controls_section( |
| 426 | 'eael_section_cta_style_settings', |
| 427 | [ |
| 428 | 'label' => esc_html__('Call to Action Style', 'essential-addons-for-elementor-lite'), |
| 429 | 'tab' => Controls_Manager::TAB_STYLE, |
| 430 | ] |
| 431 | ); |
| 432 | |
| 433 | $this->add_control( |
| 434 | 'eael_cta_container_width', |
| 435 | [ |
| 436 | 'label' => esc_html__('Set max width for the container?', 'essential-addons-for-elementor-lite'), |
| 437 | 'type' => Controls_Manager::SWITCHER, |
| 438 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 439 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 440 | 'default' => 'yes', |
| 441 | ] |
| 442 | ); |
| 443 | |
| 444 | $this->add_responsive_control( |
| 445 | 'eael_cta_container_width_value', |
| 446 | [ |
| 447 | 'label' => __('Container Max Width (% or px)', 'essential-addons-for-elementor-lite'), |
| 448 | 'type' => Controls_Manager::SLIDER, |
| 449 | 'default' => [ |
| 450 | 'size' => 1170, |
| 451 | 'unit' => 'px', |
| 452 | ], |
| 453 | 'size_units' => ['px', '%'], |
| 454 | 'range' => [ |
| 455 | 'px' => [ |
| 456 | 'min' => 0, |
| 457 | 'max' => 1500, |
| 458 | 'step' => 5, |
| 459 | ], |
| 460 | '%' => [ |
| 461 | 'min' => 1, |
| 462 | 'max' => 100, |
| 463 | ], |
| 464 | ], |
| 465 | 'selectors' => [ |
| 466 | '{{WRAPPER}} .eael-call-to-action' => 'max-width: {{SIZE}}{{UNIT}};', |
| 467 | ], |
| 468 | 'condition' => [ |
| 469 | 'eael_cta_container_width' => 'yes', |
| 470 | ], |
| 471 | ] |
| 472 | ); |
| 473 | |
| 474 | $this->add_control( |
| 475 | 'eael_cta_bg_color', |
| 476 | [ |
| 477 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 478 | 'type' => Controls_Manager::COLOR, |
| 479 | 'default' => '#f4f4f4', |
| 480 | 'selectors' => [ |
| 481 | '{{WRAPPER}} .eael-call-to-action' => 'background-color: {{VALUE}};', |
| 482 | '{{WRAPPER}} .eael-call-to-action.bg-img:after' => 'background-color: {{VALUE}};', |
| 483 | ], |
| 484 | ] |
| 485 | ); |
| 486 | |
| 487 | $this->add_control( |
| 488 | 'eael_cta_bg_color_opacity', |
| 489 | [ |
| 490 | 'label' => esc_html__('Background Color Opacity', 'essential-addons-for-elementor-lite'), |
| 491 | 'type' => Controls_Manager::SLIDER, |
| 492 | 'range' => [ |
| 493 | 'px' => [ |
| 494 | 'max' => 1, |
| 495 | 'min' => 0.10, |
| 496 | 'step' => 0.01, |
| 497 | ], |
| 498 | ], |
| 499 | 'default' => [ |
| 500 | 'size' => .8, |
| 501 | ], |
| 502 | 'selectors' => [ |
| 503 | '{{WRAPPER}} .eael-call-to-action.bg-img:after' => 'opacity: {{SIZE}};', |
| 504 | ], |
| 505 | 'condition' => [ |
| 506 | 'eael_cta_color_type!' => 'cta-bg-color', |
| 507 | 'eael_cta_bg_overlay' => 'yes', |
| 508 | ], |
| 509 | 'condition' => [ |
| 510 | 'eael_cta_preset' => 'cta-preset-2', |
| 511 | ] |
| 512 | ] |
| 513 | ); |
| 514 | |
| 515 | $this->add_control( |
| 516 | 'eael_cta_bg_color_preset_2', |
| 517 | [ |
| 518 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 519 | 'type' => Controls_Manager::COLOR, |
| 520 | 'selectors' => [ |
| 521 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1)' => 'background: {{VALUE}};', |
| 522 | ], |
| 523 | 'condition' => [ |
| 524 | 'eael_cta_preset' => 'cta-preset-2', |
| 525 | ] |
| 526 | ] |
| 527 | ); |
| 528 | |
| 529 | $this->add_responsive_control( |
| 530 | 'eael_cta_container_padding', |
| 531 | [ |
| 532 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 533 | 'type' => Controls_Manager::DIMENSIONS, |
| 534 | 'size_units' => ['px', 'em', '%'], |
| 535 | 'selectors' => [ |
| 536 | '{{WRAPPER}} .eael-call-to-action' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 537 | ], |
| 538 | ] |
| 539 | ); |
| 540 | |
| 541 | $this->add_responsive_control( |
| 542 | 'eael_cta_container_margin', |
| 543 | [ |
| 544 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 545 | 'type' => Controls_Manager::DIMENSIONS, |
| 546 | 'size_units' => ['px', 'em', '%'], |
| 547 | 'selectors' => [ |
| 548 | '{{WRAPPER}} .eael-call-to-action' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 549 | ], |
| 550 | ] |
| 551 | ); |
| 552 | |
| 553 | $this->add_group_control( |
| 554 | Group_Control_Border::get_type(), |
| 555 | [ |
| 556 | 'name' => 'eael_cta_border', |
| 557 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 558 | 'selector' => '{{WRAPPER}} .eael-call-to-action', |
| 559 | ] |
| 560 | ); |
| 561 | |
| 562 | $this->add_control( |
| 563 | 'eael_cta_border_radius', |
| 564 | [ |
| 565 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 566 | 'type' => Controls_Manager::SLIDER, |
| 567 | 'range' => [ |
| 568 | 'px' => [ |
| 569 | 'max' => 500, |
| 570 | ], |
| 571 | ], |
| 572 | 'selectors' => [ |
| 573 | '{{WRAPPER}} .eael-call-to-action' => 'border-radius: {{SIZE}}px;', |
| 574 | ], |
| 575 | ] |
| 576 | ); |
| 577 | |
| 578 | $this->add_group_control( |
| 579 | Group_Control_Box_Shadow::get_type(), |
| 580 | [ |
| 581 | 'name' => 'eael_cta_shadow', |
| 582 | 'selector' => '{{WRAPPER}} .eael-call-to-action', |
| 583 | ] |
| 584 | ); |
| 585 | |
| 586 | $this->end_controls_section(); |
| 587 | |
| 588 | /** |
| 589 | * ------------------------------------------- |
| 590 | * Tab Style (Cta Title Style) |
| 591 | * ------------------------------------------- |
| 592 | */ |
| 593 | $this->start_controls_section( |
| 594 | 'eael_section_cta_title_style_settings', |
| 595 | [ |
| 596 | 'label' => esc_html__('Color & Typography ', 'essential-addons-for-elementor-lite'), |
| 597 | 'tab' => Controls_Manager::TAB_STYLE, |
| 598 | ] |
| 599 | ); |
| 600 | |
| 601 | $this->add_control( |
| 602 | 'eael_cta_title_heading', |
| 603 | [ |
| 604 | 'label' => esc_html__('Title Style', 'essential-addons-for-elementor-lite'), |
| 605 | 'type' => Controls_Manager::HEADING, |
| 606 | ] |
| 607 | ); |
| 608 | |
| 609 | $this->add_control( |
| 610 | 'eael_cta_title_color', |
| 611 | [ |
| 612 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 613 | 'type' => Controls_Manager::COLOR, |
| 614 | 'default' => '', |
| 615 | 'selectors' => [ |
| 616 | '{{WRAPPER}} .eael-call-to-action .title' => 'color: {{VALUE}};', |
| 617 | ], |
| 618 | ] |
| 619 | ); |
| 620 | |
| 621 | $this->add_group_control( |
| 622 | Group_Control_Typography::get_type(), |
| 623 | [ |
| 624 | 'name' => 'eael_cta_title_typography', |
| 625 | 'selector' => '{{WRAPPER}} .eael-call-to-action .title', |
| 626 | ] |
| 627 | ); |
| 628 | |
| 629 | $this->add_responsive_control( |
| 630 | 'eael_cta_title_margin', |
| 631 | [ |
| 632 | 'label' => esc_html__('Space', 'essential-addons-for-elementor-lite'), |
| 633 | 'type' => Controls_Manager::DIMENSIONS, |
| 634 | 'size_units' => ['px', 'em', '%'], |
| 635 | 'selectors' => [ |
| 636 | '{{WRAPPER}} .eael-call-to-action .title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 637 | ], |
| 638 | ] |
| 639 | ); |
| 640 | // sub title |
| 641 | $this->add_control( |
| 642 | 'eael_cta_sub_title_heading', |
| 643 | [ |
| 644 | 'label' => esc_html__('Sub Title Style', 'essential-addons-for-elementor-lite'), |
| 645 | 'type' => Controls_Manager::HEADING, |
| 646 | 'separator' => 'before', |
| 647 | ] |
| 648 | ); |
| 649 | |
| 650 | $this->add_control( |
| 651 | 'eael_cta_sub_title_color', |
| 652 | [ |
| 653 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 654 | 'type' => Controls_Manager::COLOR, |
| 655 | 'default' => '', |
| 656 | 'selectors' => [ |
| 657 | '{{WRAPPER}} .eael-call-to-action .sub-title' => 'color: {{VALUE}};', |
| 658 | ], |
| 659 | ] |
| 660 | ); |
| 661 | |
| 662 | $this->add_group_control( |
| 663 | Group_Control_Typography::get_type(), |
| 664 | [ |
| 665 | 'name' => 'eael_cta_sub_title_typography', |
| 666 | 'selector' => '{{WRAPPER}} .eael-call-to-action .sub-title', |
| 667 | ] |
| 668 | ); |
| 669 | |
| 670 | $this->add_responsive_control( |
| 671 | 'eael_cta_sub_title_margin', |
| 672 | [ |
| 673 | 'label' => esc_html__('Space', 'essential-addons-for-elementor-lite'), |
| 674 | 'type' => Controls_Manager::DIMENSIONS, |
| 675 | 'size_units' => ['px', 'em', '%'], |
| 676 | 'selectors' => [ |
| 677 | '{{WRAPPER}} .eael-call-to-action .sub-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 678 | ], |
| 679 | ] |
| 680 | ); |
| 681 | |
| 682 | // content |
| 683 | $this->add_control( |
| 684 | 'eael_cta_content_heading', |
| 685 | [ |
| 686 | 'label' => esc_html__('Content Style', 'essential-addons-for-elementor-lite'), |
| 687 | 'type' => Controls_Manager::HEADING, |
| 688 | 'separator' => 'before', |
| 689 | ] |
| 690 | ); |
| 691 | |
| 692 | $this->add_control( |
| 693 | 'eael_cta_content_color', |
| 694 | [ |
| 695 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 696 | 'type' => Controls_Manager::COLOR, |
| 697 | 'default' => '', |
| 698 | 'selectors' => [ |
| 699 | '{{WRAPPER}} .eael-call-to-action p' => 'color: {{VALUE}};', |
| 700 | ], |
| 701 | ] |
| 702 | ); |
| 703 | |
| 704 | $this->add_group_control( |
| 705 | Group_Control_Typography::get_type(), |
| 706 | [ |
| 707 | 'name' => 'eael_cta_content_typography', |
| 708 | 'selector' => '{{WRAPPER}} .eael-call-to-action p', |
| 709 | ] |
| 710 | ); |
| 711 | |
| 712 | $this->end_controls_section(); |
| 713 | |
| 714 | /** |
| 715 | * ------------------------------------------- |
| 716 | * Tab Style (Primary Button Style) |
| 717 | * ------------------------------------------- |
| 718 | */ |
| 719 | $this->start_controls_section( |
| 720 | 'eael_section_cta_btn_style_settings', |
| 721 | [ |
| 722 | 'label' => esc_html__('Primary Button Style', 'essential-addons-for-elementor-lite'), |
| 723 | 'tab' => Controls_Manager::TAB_STYLE, |
| 724 | ] |
| 725 | ); |
| 726 | |
| 727 | $this->add_control( |
| 728 | 'eael_cta_btn_effect_type', |
| 729 | [ |
| 730 | 'label' => esc_html__('Effect', 'essential-addons-for-elementor-lite'), |
| 731 | 'type' => Controls_Manager::SELECT, |
| 732 | 'default' => 'default', |
| 733 | 'label_block' => false, |
| 734 | 'options' => [ |
| 735 | 'default' => esc_html__('Default', 'essential-addons-for-elementor-lite'), |
| 736 | 'top-to-bottom' => esc_html__('Top to Bottom', 'essential-addons-for-elementor-lite'), |
| 737 | 'left-to-right' => esc_html__('Left to Right', 'essential-addons-for-elementor-lite'), |
| 738 | ], |
| 739 | ] |
| 740 | ); |
| 741 | |
| 742 | $this->add_responsive_control( |
| 743 | 'eael_cta_btn_padding', |
| 744 | [ |
| 745 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 746 | 'type' => Controls_Manager::DIMENSIONS, |
| 747 | 'size_units' => ['px', 'em', '%'], |
| 748 | 'selectors' => [ |
| 749 | '{{WRAPPER}} .eael-call-to-action .cta-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 750 | ], |
| 751 | ] |
| 752 | ); |
| 753 | |
| 754 | $this->add_responsive_control( |
| 755 | 'eael_cta_btn_margin', |
| 756 | [ |
| 757 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 758 | 'type' => Controls_Manager::DIMENSIONS, |
| 759 | 'size_units' => ['px', 'em', '%'], |
| 760 | 'selectors' => [ |
| 761 | '{{WRAPPER}} .eael-call-to-action .cta-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 762 | ], |
| 763 | ] |
| 764 | ); |
| 765 | $this->add_group_control( |
| 766 | Group_Control_Typography::get_type(), |
| 767 | [ |
| 768 | 'name' => 'eael_cta_btn_typography', |
| 769 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button', |
| 770 | ] |
| 771 | ); |
| 772 | |
| 773 | $this->add_control( |
| 774 | 'eael_cta_btn_is_used_gradient_bg', |
| 775 | [ |
| 776 | 'label' => __( 'Use Gradient Background', 'essential-addons-for-elementor-lite' ), |
| 777 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 778 | 'label_on' => __( 'yes', 'essential-addons-for-elementor-lite' ), |
| 779 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 780 | 'return_value' => 'yes', |
| 781 | ] |
| 782 | ); |
| 783 | |
| 784 | $this->add_control( |
| 785 | 'eael_cta_btn_icon_size', |
| 786 | [ |
| 787 | 'label' => esc_html__('Icon Size', 'essential-addons-for-elementor-lite'), |
| 788 | 'type' => Controls_Manager::SLIDER, |
| 789 | 'range' => [ |
| 790 | 'px' => [ |
| 791 | 'max' => 50, |
| 792 | ], |
| 793 | ], |
| 794 | 'separator' => 'before', |
| 795 | 'selectors' => [ |
| 796 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2 i' => 'font-size: {{SIZE}}px;', |
| 797 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2 svg' => 'width: {{SIZE}}px; height: {{SIZE}}px;', |
| 798 | ], |
| 799 | ] |
| 800 | ); |
| 801 | |
| 802 | $this->start_controls_tabs('eael_cta_button_tabs'); |
| 803 | |
| 804 | // Normal State Tab |
| 805 | $this->start_controls_tab('eael_cta_btn_normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]); |
| 806 | |
| 807 | $this->add_control( |
| 808 | 'eael_cta_btn_normal_text_color', |
| 809 | [ |
| 810 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 811 | 'type' => Controls_Manager::COLOR, |
| 812 | 'default' => '#4d4d4d', |
| 813 | 'selectors' => [ |
| 814 | '{{WRAPPER}} .eael-call-to-action.cta-preset-1:not(.cta-preset-2) .cta-button:not(.cta-secondary-button)' => 'color: {{VALUE}};', |
| 815 | ], |
| 816 | 'condition' => [ |
| 817 | 'eael_cta_preset' => 'cta-preset-1', |
| 818 | ] |
| 819 | ] |
| 820 | ); |
| 821 | |
| 822 | $this->add_control( |
| 823 | 'eael_cta_btn_normal_text_color_preset_2', |
| 824 | [ |
| 825 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 826 | 'type' => Controls_Manager::COLOR, |
| 827 | 'selectors' => [ |
| 828 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1) .cta-button:not(.cta-secondary-button)' => 'color: {{VALUE}};', |
| 829 | ], |
| 830 | 'condition' => [ |
| 831 | 'eael_cta_preset' => 'cta-preset-2', |
| 832 | ] |
| 833 | ] |
| 834 | ); |
| 835 | |
| 836 | $this->add_control( |
| 837 | 'eael_cta_btn_normal_bg_color', |
| 838 | [ |
| 839 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 840 | 'type' => Controls_Manager::COLOR, |
| 841 | 'default' => '#f9f9f9', |
| 842 | 'selectors' => [ |
| 843 | '{{WRAPPER}} .eael-call-to-action.cta-preset-1:not(.cta-preset-2) .cta-button:not(.cta-secondary-button)' => 'background: {{VALUE}};', |
| 844 | ], |
| 845 | 'condition' => [ |
| 846 | 'eael_cta_btn_is_used_gradient_bg' => '', |
| 847 | 'eael_cta_preset' => 'cta-preset-1', |
| 848 | ] |
| 849 | ] |
| 850 | ); |
| 851 | |
| 852 | $this->add_control( |
| 853 | 'eael_cta_btn_normal_bg_color_preset_2', |
| 854 | [ |
| 855 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 856 | 'type' => Controls_Manager::COLOR, |
| 857 | 'selectors' => [ |
| 858 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1) .cta-button:not(.cta-secondary-button)' => 'background: {{VALUE}};', |
| 859 | ], |
| 860 | 'condition' => [ |
| 861 | 'eael_cta_btn_is_used_gradient_bg' => '', |
| 862 | 'eael_cta_preset' => 'cta-preset-2', |
| 863 | ] |
| 864 | ] |
| 865 | ); |
| 866 | |
| 867 | $this->add_group_control( |
| 868 | \Elementor\Group_Control_Background::get_type(), |
| 869 | [ |
| 870 | 'name' => 'eael_cta_btn_normal_gradient_bg_color', |
| 871 | 'label' => __( 'Background', 'essential-addons-for-elementor-lite' ), |
| 872 | 'types' => [ 'classic', 'gradient' ], |
| 873 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button:not(.cta-secondary-button)', |
| 874 | 'condition' => [ |
| 875 | 'eael_cta_btn_is_used_gradient_bg' => 'yes' |
| 876 | ] |
| 877 | ] |
| 878 | ); |
| 879 | |
| 880 | $this->add_group_control( |
| 881 | Group_Control_Border::get_type(), |
| 882 | [ |
| 883 | 'name' => 'eael_cat_btn_normal_border', |
| 884 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 885 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button:not(.cta-secondary-button)', |
| 886 | 'conditions' => [ |
| 887 | 'relation' => 'or', |
| 888 | 'terms' => [ |
| 889 | [ |
| 890 | 'name' => 'eael_cta_preset', |
| 891 | 'operator' => '==', |
| 892 | 'value' => 'cta-preset-1', |
| 893 | ], |
| 894 | [ |
| 895 | 'relation' => 'and', |
| 896 | 'terms' => [ |
| 897 | [ |
| 898 | 'name' => 'eael_cta_preset', |
| 899 | 'operator' => '==', |
| 900 | 'value' => 'cta-preset-2', |
| 901 | ], |
| 902 | [ |
| 903 | 'name' => 'eael_cta_btn_preset', |
| 904 | 'operator' => '==', |
| 905 | 'value' => 'cta-btn-preset-1', |
| 906 | ], |
| 907 | ] |
| 908 | ], |
| 909 | ], |
| 910 | ] |
| 911 | ] |
| 912 | ); |
| 913 | |
| 914 | $this->add_control( |
| 915 | 'eael_cta_btn_border_radius', |
| 916 | [ |
| 917 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 918 | 'type' => Controls_Manager::SLIDER, |
| 919 | 'range' => [ |
| 920 | 'px' => [ |
| 921 | 'max' => 100, |
| 922 | ], |
| 923 | ], |
| 924 | 'selectors' => [ |
| 925 | '{{WRAPPER}} .eael-call-to-action .cta-button:not(.cta-secondary-button)' => 'border-radius: {{SIZE}}px;', |
| 926 | ], |
| 927 | 'conditions' => [ |
| 928 | 'relation' => 'or', |
| 929 | 'terms' => [ |
| 930 | [ |
| 931 | 'name' => 'eael_cta_preset', |
| 932 | 'operator' => '==', |
| 933 | 'value' => 'cta-preset-1', |
| 934 | ], |
| 935 | [ |
| 936 | 'relation' => 'and', |
| 937 | 'terms' => [ |
| 938 | [ |
| 939 | 'name' => 'eael_cta_preset', |
| 940 | 'operator' => '==', |
| 941 | 'value' => 'cta-preset-2', |
| 942 | ], |
| 943 | [ |
| 944 | 'name' => 'eael_cta_btn_preset', |
| 945 | 'operator' => '==', |
| 946 | 'value' => 'cta-btn-preset-1', |
| 947 | ], |
| 948 | ] |
| 949 | ], |
| 950 | ], |
| 951 | ], |
| 952 | ] |
| 953 | ); |
| 954 | |
| 955 | $this->add_control( |
| 956 | 'eael_cta_btn_icon_bg', |
| 957 | [ |
| 958 | 'label' => esc_html__('Icon Background Color', 'essential-addons-for-elementor-lite'), |
| 959 | 'type' => Controls_Manager::COLOR, |
| 960 | 'selectors' => [ |
| 961 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2:not(.cta-secondary-button) .btn-icon' => 'background: {{VALUE}};', |
| 962 | ], |
| 963 | 'separator' => 'before', |
| 964 | 'condition' => [ |
| 965 | 'eael_cta_btn_preset' => 'cta-btn-preset-2', |
| 966 | 'eael_cta_preset' => 'cta-preset-2', |
| 967 | ] |
| 968 | ] |
| 969 | ); |
| 970 | |
| 971 | $this->add_control( |
| 972 | 'eael_cta_btn_icon_color', |
| 973 | [ |
| 974 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 975 | 'type' => Controls_Manager::COLOR, |
| 976 | 'selectors' => [ |
| 977 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2:not(.cta-secondary-button) i' => 'color: {{VALUE}};', |
| 978 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2:not(.cta-secondary-button) svg' => |
| 979 | 'fill: {{VALUE}};', |
| 980 | ], |
| 981 | 'condition' => [ |
| 982 | 'eael_cta_btn_preset' => 'cta-btn-preset-2', |
| 983 | 'eael_cta_preset' => 'cta-preset-2', |
| 984 | ] |
| 985 | ] |
| 986 | ); |
| 987 | |
| 988 | $this->end_controls_tab(); |
| 989 | |
| 990 | // Hover State Tab |
| 991 | $this->start_controls_tab('eael_cta_btn_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]); |
| 992 | |
| 993 | $this->add_control( |
| 994 | 'eael_cta_btn_hover_text_color', |
| 995 | [ |
| 996 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 997 | 'type' => Controls_Manager::COLOR, |
| 998 | 'default' => '#f9f9f9', |
| 999 | 'selectors' => [ |
| 1000 | '{{WRAPPER}} .eael-call-to-action.cta-preset-1:not(.cta-preset-2) .cta-button:hover:not(.cta-secondary-button)' => 'color: {{VALUE}};', |
| 1001 | ], |
| 1002 | 'condition' => [ |
| 1003 | 'eael_cta_preset' => 'cta-preset-1', |
| 1004 | ] |
| 1005 | ] |
| 1006 | ); |
| 1007 | |
| 1008 | $this->add_control( |
| 1009 | 'eael_cta_btn_hover_text_color_preset_2', |
| 1010 | [ |
| 1011 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 1012 | 'type' => Controls_Manager::COLOR, |
| 1013 | 'selectors' => [ |
| 1014 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1) .cta-button:hover:not(.cta-secondary-button)' => 'color: {{VALUE}};', |
| 1015 | ], |
| 1016 | 'condition' => [ |
| 1017 | 'eael_cta_preset' => 'cta-preset-2', |
| 1018 | ] |
| 1019 | ] |
| 1020 | ); |
| 1021 | |
| 1022 | $this->add_control( |
| 1023 | 'eael_cta_btn_hover_bg_color', |
| 1024 | [ |
| 1025 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 1026 | 'type' => Controls_Manager::COLOR, |
| 1027 | 'default' => '#3F51B5', |
| 1028 | 'selectors' => [ |
| 1029 | '{{WRAPPER}} .eael-call-to-action.cta-preset-1:not(.cta-preset-2) .cta-button:after:not(.cta-secondary-button)' => 'background: {{VALUE}};', |
| 1030 | '{{WRAPPER}} .eael-call-to-action.cta-preset-1:not(.cta-preset-2) .cta-button:hover:not(.cta-secondary-button)' => 'background: {{VALUE}};', |
| 1031 | ], |
| 1032 | 'condition' => [ |
| 1033 | 'eael_cta_btn_is_used_gradient_bg' => '', |
| 1034 | 'eael_cta_preset' => 'cta-preset-1', |
| 1035 | ] |
| 1036 | ] |
| 1037 | ); |
| 1038 | |
| 1039 | $this->add_control( |
| 1040 | 'eael_cta_btn_hover_bg_color_preset_2', |
| 1041 | [ |
| 1042 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 1043 | 'type' => Controls_Manager::COLOR, |
| 1044 | 'selectors' => [ |
| 1045 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1) .cta-button:after:not(.cta-secondary-button)' => 'background: {{VALUE}};', |
| 1046 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1) .cta-button:hover:not(.cta-secondary-button)' => 'background: {{VALUE}};', |
| 1047 | ], |
| 1048 | 'condition' => [ |
| 1049 | 'eael_cta_btn_is_used_gradient_bg' => '', |
| 1050 | 'eael_cta_preset' => 'cta-preset-2', |
| 1051 | ] |
| 1052 | ] |
| 1053 | ); |
| 1054 | |
| 1055 | |
| 1056 | $this->add_group_control( |
| 1057 | \Elementor\Group_Control_Background::get_type(), |
| 1058 | [ |
| 1059 | 'name' => 'eael_cta_btn_hover_gradient_bg_color', |
| 1060 | 'label' => __( 'Background', 'essential-addons-for-elementor-lite' ), |
| 1061 | 'types' => [ 'classic', 'gradient' ], |
| 1062 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button:hover:not(.cta-secondary-button)', |
| 1063 | 'condition' => [ |
| 1064 | 'eael_cta_btn_is_used_gradient_bg' => 'yes' |
| 1065 | ] |
| 1066 | ] |
| 1067 | ); |
| 1068 | |
| 1069 | $this->add_control( |
| 1070 | 'eael_cta_btn_hover_border_color', |
| 1071 | [ |
| 1072 | 'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'), |
| 1073 | 'type' => Controls_Manager::COLOR, |
| 1074 | 'default' => '', |
| 1075 | 'selectors' => [ |
| 1076 | '{{WRAPPER}} .eael-call-to-action .cta-button:hover:not(.cta-secondary-button)' => 'border-color: {{VALUE}};', |
| 1077 | ], |
| 1078 | 'condition' => [ |
| 1079 | 'eael_cta_btn_preset!' => 'cta-btn-preset-2', |
| 1080 | 'eael_cta_preset!' => 'cta-preset-2', |
| 1081 | ] |
| 1082 | ] |
| 1083 | |
| 1084 | ); |
| 1085 | $this->add_control( |
| 1086 | 'eael_cta_btn_icon_bg_hover', |
| 1087 | [ |
| 1088 | 'label' => esc_html__('Icon Background Color', 'essential-addons-for-elementor-lite'), |
| 1089 | 'type' => Controls_Manager::COLOR, |
| 1090 | 'selectors' => [ |
| 1091 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2:not(.cta-secondary-button):hover .btn-icon' => |
| 1092 | 'background: {{VALUE}};', |
| 1093 | ], |
| 1094 | 'separator' => 'before', |
| 1095 | 'condition' => [ |
| 1096 | 'eael_cta_btn_preset' => 'cta-btn-preset-2', |
| 1097 | 'eael_cta_preset' => 'cta-preset-2', |
| 1098 | ] |
| 1099 | ] |
| 1100 | ); |
| 1101 | |
| 1102 | $this->add_control( |
| 1103 | 'eael_cta_btn_icon_color_hover', |
| 1104 | [ |
| 1105 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 1106 | 'type' => Controls_Manager::COLOR, |
| 1107 | 'selectors' => [ |
| 1108 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2:not(.cta-secondary-button):hover i' => 'color: {{VALUE}};', |
| 1109 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-btn-preset-2:not(.cta-secondary-button):hover svg' => 'fill: {{VALUE}};', |
| 1110 | ], |
| 1111 | 'condition' => [ |
| 1112 | 'eael_cta_btn_preset' => 'cta-btn-preset-2', |
| 1113 | 'eael_cta_preset' => 'cta-preset-2', |
| 1114 | ] |
| 1115 | ] |
| 1116 | ); |
| 1117 | |
| 1118 | $this->end_controls_tab(); |
| 1119 | |
| 1120 | $this->end_controls_tabs(); |
| 1121 | |
| 1122 | $this->add_group_control( |
| 1123 | Group_Control_Box_Shadow::get_type(), |
| 1124 | [ |
| 1125 | 'name' => 'eael_cta_button_shadow', |
| 1126 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button:not(.cta-secondary-button)', |
| 1127 | 'separator' => 'before', |
| 1128 | ] |
| 1129 | ); |
| 1130 | |
| 1131 | $this->end_controls_section(); |
| 1132 | |
| 1133 | /** |
| 1134 | * ------------------------------------------- |
| 1135 | * Tab Style (Secondary Button Style) |
| 1136 | * ------------------------------------------- |
| 1137 | */ |
| 1138 | $this->start_controls_section( |
| 1139 | 'eael_section_cta_secondary_btn_style_settings', |
| 1140 | [ |
| 1141 | 'label' => esc_html__('Secondary Button Style', 'essential-addons-for-elementor-lite'), |
| 1142 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1143 | 'condition' => [ |
| 1144 | 'eael_cta_secondary_btn_is_show' => 'yes', |
| 1145 | ], |
| 1146 | ] |
| 1147 | ); |
| 1148 | |
| 1149 | $this->add_control( |
| 1150 | 'eael_cta_secondary_btn_effect_type', |
| 1151 | [ |
| 1152 | 'label' => esc_html__('Effect', 'essential-addons-for-elementor-lite'), |
| 1153 | 'type' => Controls_Manager::SELECT, |
| 1154 | 'default' => 'default', |
| 1155 | 'label_block' => false, |
| 1156 | 'options' => [ |
| 1157 | 'default' => esc_html__('Default', 'essential-addons-for-elementor-lite'), |
| 1158 | 'top-to-bottom' => esc_html__('Top to Bottom', 'essential-addons-for-elementor-lite'), |
| 1159 | 'left-to-right' => esc_html__('Left to Right', 'essential-addons-for-elementor-lite'), |
| 1160 | ], |
| 1161 | ] |
| 1162 | ); |
| 1163 | |
| 1164 | $this->add_responsive_control( |
| 1165 | 'eael_cta_secondary_btn_padding', |
| 1166 | [ |
| 1167 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 1168 | 'type' => Controls_Manager::DIMENSIONS, |
| 1169 | 'size_units' => ['px', 'em', '%'], |
| 1170 | 'selectors' => [ |
| 1171 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1172 | ], |
| 1173 | ] |
| 1174 | ); |
| 1175 | |
| 1176 | $this->add_responsive_control( |
| 1177 | 'eael_cta_secondary_btn_margin', |
| 1178 | [ |
| 1179 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 1180 | 'type' => Controls_Manager::DIMENSIONS, |
| 1181 | 'size_units' => ['px', 'em', '%'], |
| 1182 | 'selectors' => [ |
| 1183 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1184 | ], |
| 1185 | ] |
| 1186 | ); |
| 1187 | $this->add_group_control( |
| 1188 | Group_Control_Typography::get_type(), |
| 1189 | [ |
| 1190 | 'name' => 'eael_cta_secondary_btn_typography', |
| 1191 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button', |
| 1192 | ] |
| 1193 | ); |
| 1194 | |
| 1195 | $this->start_controls_tabs('eael_cta_secondary_button_tabs'); |
| 1196 | |
| 1197 | // Normal State Tab |
| 1198 | $this->start_controls_tab('eael_cta_secondary_btn_normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]); |
| 1199 | |
| 1200 | $this->add_control( |
| 1201 | 'eael_cta_secondary_btn_normal_text_color', |
| 1202 | [ |
| 1203 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 1204 | 'type' => Controls_Manager::COLOR, |
| 1205 | 'default' => '#4d4d4d', |
| 1206 | 'selectors' => [ |
| 1207 | '{{WRAPPER}} .eael-call-to-action.cta-preset-1:not(.cta-preset-2) .cta-button.cta-secondary-button' => 'color: {{VALUE}};', |
| 1208 | ], |
| 1209 | 'condition' => [ |
| 1210 | 'eael_cta_preset' => 'cta-preset-1', |
| 1211 | ] |
| 1212 | ] |
| 1213 | ); |
| 1214 | |
| 1215 | $this->add_control( |
| 1216 | 'eael_cta_secondary_btn_normal_text_color_preset_2', |
| 1217 | [ |
| 1218 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 1219 | 'type' => Controls_Manager::COLOR, |
| 1220 | 'selectors' => [ |
| 1221 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1) .cta-button.cta-secondary-button' => 'color: {{VALUE}};', |
| 1222 | ], |
| 1223 | 'condition' => [ |
| 1224 | 'eael_cta_preset' => 'cta-preset-2', |
| 1225 | ] |
| 1226 | ] |
| 1227 | ); |
| 1228 | |
| 1229 | $this->add_group_control( |
| 1230 | \Elementor\Group_Control_Background::get_type(), |
| 1231 | [ |
| 1232 | 'name' => 'eael_cta_secondary_btn_normal_bg_color', |
| 1233 | 'label' => __( 'Background', 'essential-addons-for-elementor-lite' ), |
| 1234 | 'types' => [ 'classic', 'gradient' ], |
| 1235 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button', |
| 1236 | ] |
| 1237 | ); |
| 1238 | |
| 1239 | $this->add_group_control( |
| 1240 | Group_Control_Border::get_type(), |
| 1241 | [ |
| 1242 | 'name' => 'eael_cat_secondary_btn_normal_border', |
| 1243 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 1244 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button', |
| 1245 | ] |
| 1246 | ); |
| 1247 | |
| 1248 | $this->add_control( |
| 1249 | 'eael_cta_secondary_btn_border_radius', |
| 1250 | [ |
| 1251 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 1252 | 'type' => Controls_Manager::SLIDER, |
| 1253 | 'range' => [ |
| 1254 | 'px' => [ |
| 1255 | 'max' => 100, |
| 1256 | ], |
| 1257 | ], |
| 1258 | 'selectors' => [ |
| 1259 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button' => 'border-radius: {{SIZE}}px;', |
| 1260 | ], |
| 1261 | ] |
| 1262 | ); |
| 1263 | |
| 1264 | $this->end_controls_tab(); |
| 1265 | |
| 1266 | // Hover State Tab |
| 1267 | $this->start_controls_tab('eael_cta_secondary_btn_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]); |
| 1268 | |
| 1269 | $this->add_control( |
| 1270 | 'eael_cta_secondary_btn_hover_text_color', |
| 1271 | [ |
| 1272 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 1273 | 'type' => Controls_Manager::COLOR, |
| 1274 | 'default' => '#f9f9f9', |
| 1275 | 'selectors' => [ |
| 1276 | '{{WRAPPER}} .eael-call-to-action.cta-preset-1:not(.cta-preset-2) .cta-button.cta-secondary-button:hover' => 'color: {{VALUE}};', |
| 1277 | ], |
| 1278 | 'condition' => [ |
| 1279 | 'eael_cta_preset' => 'cta-preset-1', |
| 1280 | ] |
| 1281 | ] |
| 1282 | ); |
| 1283 | |
| 1284 | $this->add_control( |
| 1285 | 'eael_cta_secondary_btn_hover_text_color_preset_2', |
| 1286 | [ |
| 1287 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 1288 | 'type' => Controls_Manager::COLOR, |
| 1289 | 'selectors' => [ |
| 1290 | '{{WRAPPER}} .eael-call-to-action.cta-preset-2:not(.cta-preset-1) .cta-button.cta-secondary-button:hover' => 'color: {{VALUE}};', |
| 1291 | ], |
| 1292 | 'condition' => [ |
| 1293 | 'eael_cta_preset' => 'cta-preset-2', |
| 1294 | ] |
| 1295 | ] |
| 1296 | ); |
| 1297 | |
| 1298 | $this->add_group_control( |
| 1299 | \Elementor\Group_Control_Background::get_type(), |
| 1300 | [ |
| 1301 | 'name' => 'eael_cta_secondary_btn_hover_bg_color', |
| 1302 | 'label' => __( 'Background', 'essential-addons-for-elementor-lite' ), |
| 1303 | 'types' => [ 'classic', 'gradient' ], |
| 1304 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button:after, {{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button:hover', |
| 1305 | ] |
| 1306 | ); |
| 1307 | |
| 1308 | $this->add_control( |
| 1309 | 'eael_cta_secondary_btn_hover_border_color', |
| 1310 | [ |
| 1311 | 'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'), |
| 1312 | 'type' => Controls_Manager::COLOR, |
| 1313 | 'default' => '', |
| 1314 | 'selectors' => [ |
| 1315 | '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button:hover' => 'border-color: {{VALUE}};', |
| 1316 | ], |
| 1317 | ] |
| 1318 | |
| 1319 | ); |
| 1320 | |
| 1321 | $this->end_controls_tab(); |
| 1322 | |
| 1323 | $this->end_controls_tabs(); |
| 1324 | |
| 1325 | $this->add_group_control( |
| 1326 | Group_Control_Box_Shadow::get_type(), |
| 1327 | [ |
| 1328 | 'name' => 'eael_cta_secondary_button_shadow', |
| 1329 | 'selector' => '{{WRAPPER}} .eael-call-to-action .cta-button.cta-secondary-button', |
| 1330 | 'separator' => 'before', |
| 1331 | ] |
| 1332 | ); |
| 1333 | |
| 1334 | $this->end_controls_section(); |
| 1335 | |
| 1336 | /** |
| 1337 | * ------------------------------------------- |
| 1338 | * Tab Style (Icon Style) |
| 1339 | * ------------------------------------------- |
| 1340 | */ |
| 1341 | $this->start_controls_section( |
| 1342 | 'eael_section_cta_icon_style_settings', |
| 1343 | [ |
| 1344 | 'label' => esc_html__('Icon Style', 'essential-addons-for-elementor-lite'), |
| 1345 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1346 | 'condition' => [ |
| 1347 | 'eael_cta_type' => 'cta-icon-flex', |
| 1348 | ], |
| 1349 | ] |
| 1350 | ); |
| 1351 | |
| 1352 | $this->add_control( |
| 1353 | 'eael_section_cta_icon_size', |
| 1354 | [ |
| 1355 | 'label' => esc_html__('Font Size', 'essential-addons-for-elementor-lite'), |
| 1356 | 'type' => Controls_Manager::SLIDER, |
| 1357 | 'default' => [ |
| 1358 | 'size' => 80, |
| 1359 | ], |
| 1360 | 'range' => [ |
| 1361 | 'px' => [ |
| 1362 | 'max' => 160, |
| 1363 | ], |
| 1364 | ], |
| 1365 | 'selectors' => [ |
| 1366 | '{{WRAPPER}} .eael-call-to-action.cta-icon-flex .icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1367 | '{{WRAPPER}} .eael-call-to-action.cta-icon-flex .icon img' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};', |
| 1368 | ], |
| 1369 | ] |
| 1370 | ); |
| 1371 | |
| 1372 | $this->add_control( |
| 1373 | 'eael_section_cta_icon_color', |
| 1374 | [ |
| 1375 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 1376 | 'type' => Controls_Manager::COLOR, |
| 1377 | 'default' => '#444', |
| 1378 | 'selectors' => [ |
| 1379 | '{{WRAPPER}} .eael-call-to-action.cta-icon-flex .icon' => 'color: {{VALUE}};', |
| 1380 | ], |
| 1381 | 'condition' => [ |
| 1382 | 'eael_cta_preset' => 'cta-preset-1', |
| 1383 | ] |
| 1384 | ] |
| 1385 | ); |
| 1386 | |
| 1387 | $this->add_control( |
| 1388 | 'eael_section_cta_icon_color_preset_2', |
| 1389 | [ |
| 1390 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 1391 | 'type' => Controls_Manager::COLOR, |
| 1392 | 'selectors' => [ |
| 1393 | '{{WRAPPER}} .eael-call-to-action.cta-icon-flex .icon' => 'color: {{VALUE}};', |
| 1394 | ], |
| 1395 | 'condition' => [ |
| 1396 | 'eael_cta_preset' => 'cta-preset-2', |
| 1397 | ] |
| 1398 | ] |
| 1399 | ); |
| 1400 | |
| 1401 | $this->end_controls_section(); |
| 1402 | |
| 1403 | } |
| 1404 | |
| 1405 | protected function render() |
| 1406 | { |
| 1407 | |
| 1408 | $settings = $this->get_settings_for_display(); |
| 1409 | $sub_title = Helper::eael_wp_kses($settings['eael_cta_sub_title']); |
| 1410 | $icon_migrated = isset($settings['__fa4_migrated']['eael_cta_flex_grid_icon_new']); |
| 1411 | $icon_is_new = empty($settings['eael_cta_flex_grid_icon']); |
| 1412 | |
| 1413 | if ('cta-bg-color' == $settings['eael_cta_color_type']) { |
| 1414 | $cta_class = 'bg-lite'; |
| 1415 | } else if ('cta-bg-img' == $settings['eael_cta_color_type']) { |
| 1416 | $cta_class = 'bg-img'; |
| 1417 | } else if ('cta-bg-img-fixed' == $settings['eael_cta_color_type']) { |
| 1418 | $cta_class = 'bg-img bg-fixed'; |
| 1419 | } else { |
| 1420 | $cta_class = ''; |
| 1421 | } |
| 1422 | |
| 1423 | // Primary Button Effect |
| 1424 | $cta_btn_effect = ''; |
| 1425 | if ('left-to-right' == $settings['eael_cta_btn_effect_type']) { |
| 1426 | $cta_btn_effect = 'effect-2'; |
| 1427 | } elseif ('top-to-bottom' == $settings['eael_cta_btn_effect_type']) { |
| 1428 | $cta_btn_effect = 'effect-1'; |
| 1429 | } |
| 1430 | // Secondary Button Effect |
| 1431 | $cta_secondary_btn_effect = ''; |
| 1432 | if ('left-to-right' == $settings['eael_cta_secondary_btn_effect_type']) { |
| 1433 | $cta_secondary_btn_effect = 'effect-2'; |
| 1434 | } elseif ('top-to-bottom' == $settings['eael_cta_secondary_btn_effect_type']) { |
| 1435 | $cta_secondary_btn_effect = 'effect-1'; |
| 1436 | } |
| 1437 | |
| 1438 | // Heading Markup |
| 1439 | $headingMarkup = ''; |
| 1440 | if(!empty($sub_title)){ |
| 1441 | $headingMarkup .='<h4 class="sub-title">'.$sub_title.'</h4>'; |
| 1442 | } |
| 1443 | $headingMarkup .='<'.Helper::eael_validate_html_tag($settings['title_tag']).' class="title">'.Helper::eael_wp_kses($settings['eael_cta_title']).'</'.Helper::eael_validate_html_tag($settings['title_tag']).'>'; |
| 1444 | |
| 1445 | // content markup |
| 1446 | $contentMarkup = ''; |
| 1447 | if ('content' == $settings['eael_cta_title_content_type']) { |
| 1448 | $contentMarkup .='<p>'.$settings['eael_cta_content'].'</p>'; |
| 1449 | }else if ('template' == $settings['eael_cta_title_content_type']){ |
| 1450 | if (!empty($settings['eael_primary_templates'])) { |
| 1451 | $eael_template_id = $settings['eael_primary_templates']; |
| 1452 | $eael_frontend = new \Elementor\Frontend; |
| 1453 | $contentMarkup .= $eael_frontend->get_builder_content($eael_template_id, true); |
| 1454 | } |
| 1455 | } |
| 1456 | |
| 1457 | // button attributes |
| 1458 | if ( ! empty( $settings['eael_cta_btn_link']['url'] ) ) { |
| 1459 | $this->add_link_attributes( 'button', $settings['eael_cta_btn_link'] ); |
| 1460 | } |
| 1461 | $this->add_render_attribute( 'button', 'class', "cta-button {$settings['eael_cta_btn_preset']} {$cta_btn_effect}" ); |
| 1462 | |
| 1463 | if($settings['eael_cta_btn_preset'] === 'cta-btn-preset-2'){ |
| 1464 | $btn_icon_wrap = '<span class="btn-icon">'; |
| 1465 | ob_start(); |
| 1466 | Icons_Manager::render_icon( $settings['eael_cta_btn_icon'], [ 'aria-hidden' => 'true' ] ); |
| 1467 | $btn_icon = ob_get_clean(); |
| 1468 | $btn_icon_wrap_end = '</span>'; |
| 1469 | } else { |
| 1470 | $btn_icon_wrap = ''; |
| 1471 | $btn_icon = ''; |
| 1472 | $btn_icon_wrap_end = ''; |
| 1473 | } |
| 1474 | |
| 1475 | |
| 1476 | // button markup |
| 1477 | $buttonMarkup = ''; |
| 1478 | $buttonMarkup .= '<a ' . $this->get_render_attribute_string( 'button' ) . '>'. $btn_icon_wrap. $btn_icon . |
| 1479 | $btn_icon_wrap_end . |
| 1480 | esc_html( |
| 1481 | $settings['eael_cta_btn_text'] ) . '</a>'; |
| 1482 | |
| 1483 | if ( $settings['eael_cta_secondary_btn_is_show'] === 'yes' ) { |
| 1484 | // button attributes |
| 1485 | if ( ! empty( $settings['eael_cta_secondary_btn_link']['url'] ) ) { |
| 1486 | $this->add_link_attributes( 'secondary_button', $settings['eael_cta_secondary_btn_link'] ); |
| 1487 | } |
| 1488 | $this->add_render_attribute( 'secondary_button', 'class', "cta-button cta-secondary-button {$cta_secondary_btn_effect}" ); |
| 1489 | |
| 1490 | // button markup |
| 1491 | $buttonMarkup .= '<a ' . $this->get_render_attribute_string( 'secondary_button' ) . '>' . esc_html( $settings['eael_cta_secondary_btn_text'] ) . '</a>'; |
| 1492 | } |
| 1493 | ?> |
| 1494 | <?php if ('cta-basic' == $settings['eael_cta_type']): ?> |
| 1495 | <div class="eael-call-to-action cta-basic <?php echo esc_attr($cta_class). ' ' . $settings['eael_cta_preset']; ?>"> |
| 1496 | <?php |
| 1497 | print $headingMarkup; |
| 1498 | print $contentMarkup; |
| 1499 | print $buttonMarkup; |
| 1500 | ?> |
| 1501 | </div> |
| 1502 | <?php endif;?> |
| 1503 | <?php if ('cta-flex' == $settings['eael_cta_type']): ?> |
| 1504 | <div class="eael-call-to-action cta-flex <?php echo esc_attr($cta_class). ' ' . $settings['eael_cta_preset']; ?>"> |
| 1505 | <div class="content"> |
| 1506 | <?php |
| 1507 | print $headingMarkup; |
| 1508 | print $contentMarkup; |
| 1509 | ?> |
| 1510 | </div> |
| 1511 | <div class="action"> |
| 1512 | <?php print $buttonMarkup; ?> |
| 1513 | </div> |
| 1514 | </div> |
| 1515 | <?php endif;?> |
| 1516 | <?php if ('cta-icon-flex' == $settings['eael_cta_type']): ?> |
| 1517 | <div class="eael-call-to-action cta-icon-flex <?php echo esc_attr($cta_class). ' ' . $settings['eael_cta_preset']; ?>"> |
| 1518 | <div class="icon"> |
| 1519 | <?php if ($icon_is_new || $icon_migrated) {?> |
| 1520 | <?php if (isset($settings['eael_cta_flex_grid_icon_new']['value']['url'])): ?> |
| 1521 | <img src="<?php echo esc_attr($settings['eael_cta_flex_grid_icon_new']['value']['url']); ?>" alt="<?php echo esc_attr(get_post_meta($settings['eael_cta_flex_grid_icon_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" /> |
| 1522 | <?php else: ?> |
| 1523 | <i class="<?php echo esc_attr($settings['eael_cta_flex_grid_icon_new']['value']); ?>"></i> |
| 1524 | <?php endif;?> |
| 1525 | <?php } else {?> |
| 1526 | <i class="<?php echo esc_attr($settings['eael_cta_flex_grid_icon']); ?>"></i> |
| 1527 | <?php }?> |
| 1528 | </div> |
| 1529 | <div class="content"> |
| 1530 | <?php |
| 1531 | print $headingMarkup; |
| 1532 | print $contentMarkup; |
| 1533 | ?> |
| 1534 | </div> |
| 1535 | <div class="action"> |
| 1536 | <?php print $buttonMarkup; ?> |
| 1537 | </div> |
| 1538 | </div> |
| 1539 | <?php endif;?> |
| 1540 | <?php |
| 1541 | } |
| 1542 | } |
| 1543 |