PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.65
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.65
51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 51.1.47 51.1.49 All 37 releases
king-addons / includes / features / Advanced_Border_Radius / Advanced_Border_Radius.php

Advanced_Border_Radius.php in King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder 51.1.65, at includes/features/Advanced_Border_Radius/Advanced_Border_Radius.php

95 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php /** @noinspection SpellCheckingInspection, PhpUnused */
2
3 namespace King_Addons;
4
5 use Elementor\Controls_Manager;
6
7 if (!defined('ABSPATH')) {
8 exit; // Exit if accessed directly.
9 }
10
11 class Advanced_Border_Radius
12 {
13 private static ?Advanced_Border_Radius $_instance = null;
14
15 public static function instance(): Advanced_Border_Radius
16 {
17 if (is_null(self::$_instance)) {
18 self::$_instance = new self();
19 }
20 return self::$_instance;
21 }
22
23 public function __construct()
24 {
25 add_action('elementor/element/container/section_layout/after_section_end', [__CLASS__, 'addControls'], 1);
26 add_action('elementor/element/column/section_advanced/after_section_end', [__CLASS__, 'addControls'], 1);
27 add_action('elementor/element/section/section_advanced/after_section_end', [__CLASS__, 'addControls'], 1);
28 add_action('elementor/element/common/_section_style/after_section_end', [__CLASS__, 'addControls'], 1);
29 }
30
31 public static function addControls($section): void
32 {
33 $section->start_controls_section(
34 'kng_adv_border_radius_section',
35 [
36 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Advanced Border Radius', 'king-addons'),
37 'tab' => Controls_Manager::TAB_ADVANCED
38 ]
39 );
40
41 $section->add_control(
42 'kng_adv_border_radius_enable',
43 [
44 'label' => esc_html__('Enable Advanced Border Radius', 'king-addons'),
45 'type' => Controls_Manager::SWITCHER,
46 'description' => esc_html__('Apply custom radius values. Get the radius value from ', 'king-addons') . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>',
47 'default' => '',
48 'return_value' => 'yes',
49 'label_on' => esc_html__('Yes', 'king-addons'),
50 'label_off' => esc_html__('No', 'king-addons'),
51 'prefix_class' => 'king-addons-adv-border-radius-',
52 ]
53 );
54
55 $section->add_responsive_control(
56 'kng_adv_border_radius_value',
57 [
58 'label' => esc_html__('Border Radius', 'king-addons'),
59 'type' => Controls_Manager::TEXT,
60 'default' => '30% 70% 70% 30% / 30% 30% 70% 70%',
61 'selectors' => [
62 '{{WRAPPER}}.king-addons-adv-border-radius-yes' => 'border-radius: {{VALUE}} !important;'
63 ],
64 'condition' => [
65 'kng_adv_border_radius_enable' => 'yes'
66 ],
67 'ai' => [
68 'active' => false,
69 ],
70 ]
71 );
72
73 $section->add_responsive_control(
74 'kng_adv_border_radius_overflow',
75 [
76 'label' => esc_html__('Overflow', 'king-addons'),
77 'type' => Controls_Manager::SELECT,
78 'options' => array(
79 'visible' => esc_html__('Visible', 'king-addons'),
80 'hidden' => esc_html__('Hidden', 'king-addons'),
81 'scroll' => esc_html__('Scroll', 'king-addons'),
82 ),
83 'default' => 'hidden',
84 'selectors' => array(
85 '{{WRAPPER}}.king-addons-adv-border-radius-yes' => 'overflow: {{VALUE}} !important;',
86 ),
87 'condition' => [
88 'kng_adv_border_radius_enable' => 'yes'
89 ],
90 ]
91 );
92
93 $section->end_controls_section();
94 }
95 }