PluginProbe
Elementor Website Builder – more than just a page builder / 3.9.1
Elementor Website Builder – more than just a page builder v3.9.1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / controls / groups / border.php

border.php in Elementor Website Builder – more than just a page builder 3.9.1, at includes/controls/groups/border.php

120 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor border control.
10 *
11 * A base control for creating border control. Displays input fields to define
12 * border type, border width and border color.
13 *
14 * @since 1.0.0
15 */
16 class Group_Control_Border extends Group_Control_Base {
17
18 /**
19 * Fields.
20 *
21 * Holds all the border control fields.
22 *
23 * @since 1.0.0
24 * @access protected
25 * @static
26 *
27 * @var array Border control fields.
28 */
29 protected static $fields;
30
31 /**
32 * Get border control type.
33 *
34 * Retrieve the control type, in this case `border`.
35 *
36 * @since 1.0.0
37 * @access public
38 * @static
39 *
40 * @return string Control type.
41 */
42 public static function get_type() {
43 return 'border';
44 }
45
46 /**
47 * Init fields.
48 *
49 * Initialize border control fields.
50 *
51 * @since 1.2.2
52 * @access protected
53 *
54 * @return array Control fields.
55 */
56 protected function init_fields() {
57 $fields = [];
58
59 $fields['border'] = [
60 'label' => esc_html_x( 'Border Type', 'Border Control', 'elementor' ),
61 'type' => Controls_Manager::SELECT,
62 'options' => [
63 '' => esc_html__( 'Default', 'elementor' ),
64 'none' => esc_html__( 'None', 'elementor' ),
65 'solid' => esc_html_x( 'Solid', 'Border Control', 'elementor' ),
66 'double' => esc_html_x( 'Double', 'Border Control', 'elementor' ),
67 'dotted' => esc_html_x( 'Dotted', 'Border Control', 'elementor' ),
68 'dashed' => esc_html_x( 'Dashed', 'Border Control', 'elementor' ),
69 'groove' => esc_html_x( 'Groove', 'Border Control', 'elementor' ),
70 ],
71 'selectors' => [
72 '{{SELECTOR}}' => 'border-style: {{VALUE}};',
73 ],
74 ];
75
76 $fields['width'] = [
77 'label' => esc_html_x( 'Width', 'Border Control', 'elementor' ),
78 'type' => Controls_Manager::DIMENSIONS,
79 'selectors' => [
80 '{{SELECTOR}}' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
81 ],
82 'condition' => [
83 'border!' => [ '', 'none' ],
84 ],
85 'responsive' => true,
86 ];
87
88 $fields['color'] = [
89 'label' => esc_html_x( 'Color', 'Border Control', 'elementor' ),
90 'type' => Controls_Manager::COLOR,
91 'default' => '',
92 'selectors' => [
93 '{{SELECTOR}}' => 'border-color: {{VALUE}};',
94 ],
95 'condition' => [
96 'border!' => [ '', 'none' ],
97 ],
98 ];
99
100 return $fields;
101 }
102
103 /**
104 * Get default options.
105 *
106 * Retrieve the default options of the border control. Used to return the
107 * default options while initializing the border control.
108 *
109 * @since 1.9.0
110 * @access protected
111 *
112 * @return array Default border control options.
113 */
114 protected function get_default_options() {
115 return [
116 'popover' => false,
117 ];
118 }
119 }
120