PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.1.9
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.1.9
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / inc / admin / widget-builder / controls / divider.php

divider.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.1.9, at inc/admin/widget-builder/controls/divider.php

72 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MasterAddons\Inc\Admin\WidgetBuilder\Controls;
3
4 use MasterAddons\Inc\Admin\WidgetBuilder\Controls\Control_Base;
5
6 defined('ABSPATH') || exit;
7
8 /**
9 * DIVIDER Control
10 * Handles Elementor DIVIDER control type
11 * Visual divider/separator between controls
12 *
13 * Supported properties:
14 * - label: Optional label for the divider
15 * - name: Field name (used for control key)
16 * - style: Divider style (default, thick, double)
17 *
18 * Common settings (handled by base class):
19 * - separator: Control separator position
20 * - condition: Conditional display logic
21 *
22 * Note: DIVIDER is a visual separator, it doesn't store any value
23 */
24 class Divider extends Control_Base {
25
26 public function get_type() {
27 return 'DIVIDER';
28 }
29
30 public function build($control_key, $field) {
31 // Check if responsive control
32 $is_responsive = isset($field['responsive']) && $field['responsive'];
33
34 // Build control header without label for divider
35 $content = "\t\t\$this->add_control(\n";
36 $content .= "\t\t\t'{$control_key}',\n";
37 $content .= "\t\t\t[\n";
38 $content .= "\t\t\t\t'type' => Controls_Manager::DIVIDER,\n";
39
40 // Style property
41 if (!empty($field['style'])) {
42 $content .= "\t\t\t\t'style' => '" . esc_js($field['style']) . "',\n";
43 }
44
45 // Add common properties (separator, condition)
46 $content .= $this->build_common_properties($field);
47
48 // Close control
49 $content .= "\t\t\t]\n";
50 $content .= "\t\t);\n\n";
51
52 return $content;
53 }
54
55 /**
56 * DIVIDER has no label and is never responsive (mirrors build()).
57 */
58 public function get_config($control_key, $field) {
59 $args = ['type' => $this->type_constant()];
60 if (!empty($field['style'])) {
61 $args['style'] = $field['style'];
62 }
63 $args = array_merge($args, $this->get_common_config($field));
64
65 return [
66 'key' => $control_key,
67 'responsive' => false,
68 'args' => $args,
69 ];
70 }
71 }
72