-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrid-settings.php
66 lines (60 loc) · 1.5 KB
/
grid-settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
if (!defined('ABSPATH')) exit;
/**
* @param \Elementor\Core\Settings\EditorPreferences\Model $preferences The editor preferences model.
*/
function add_preferences_controls(\Elementor\Core\Settings\EditorPreferences\Model $preferences)
{
$preferences->start_injection(
[
'at' => 'after',
'of' => 'show_hidden_elements',
]
);
$preferences->add_control(
'styliner_grid',
[
'label' => esc_html__('Enable Styliner Grid', 'textdomain'),
'type' => \Elementor\Controls_Manager::SWITCHER,
'default' => 'no',
'selectors' => [
'#styliner-grid-system' => 'display: block !important;'
]
]
);
$preferences->add_control(
'styliner_grid_color',
[
'label' => esc_html__('Grid Color', 'textdomain'),
'type' => \Elementor\Controls_Manager::COLOR,
'default' => "#ff000026",
'condition' => [
'styliner_grid' => 'yes'
]
]
);
$preferences->add_control(
'styliner_columns_color',
[
'label' => esc_html__('Columns Color', 'textdomain'),
'type' => \Elementor\Controls_Manager::COLOR,
'default' => "#ff00000A",
'condition' => [
'styliner_grid' => 'yes'
]
]
);
$preferences->add_control(
'styliner_rows_color',
[
'label' => esc_html__('Rows Color', 'textdomain'),
'type' => \Elementor\Controls_Manager::COLOR,
'default' => "#ff00000A",
'condition' => [
'styliner_grid' => 'yes'
]
]
);
$preferences->end_injection();
}
add_action('elementor/element/editor-preferences/preferences/before_section_end', 'add_preferences_controls');