PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 4.1.6
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v4.1.6
4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / EmbedPress / Includes / Traits / Branding.php
embedpress / EmbedPress / Includes / Traits Last commit date
Branding.php 1 year ago Shared.php 1 year ago
Branding.php
211 lines
1 <?php
2
3 namespace EmbedPress\Includes\Traits;
4
5 if (!defined('ABSPATH')) {
6 exit;
7 } // Exit if accessed directly
8 use Elementor\Controls_Manager as Controls_Manager;
9 use Elementor\Group_Control_Image_Size;
10 use EmbedPress\Includes\Classes\Helper;
11
12
13 trait Branding
14 {
15 /**
16 * @param string $provider_name
17 */
18 public function init_branding_controls($provider_name = '')
19 {
20 if (!isset($this->pro_class)) {
21 $this->pro_class = '';
22 }
23 if (!isset($this->pro_text)) {
24 $this->pro_text = '';
25 }
26 $logo_condition = [
27 "embedpress_pro_{$provider_name}_logo[url]!" => ''
28 ];
29 $condition = [];
30 if ($provider_name !== 'document') {
31 $logo_condition["embedpress_pro_embeded_source"] = $provider_name;
32 $condition["embedpress_pro_embeded_source"] = $provider_name;
33 }
34 $this->add_control(
35 "{$provider_name}_custom_logo_cta_heading",
36 [
37 'label' => __('Custom Branding', 'embedpress'),
38 'type' => Controls_Manager::HEADING,
39 'separator' => 'before',
40 'condition' => $condition,
41 ]
42 );
43 $this->add_control(
44 "embedpress_pro_{$provider_name}_logo",
45 [
46 'label' => sprintf(__('Custom Logo %s', 'embedpress'), $this->pro_text),
47 'description' => __('Leave it empty to hide it', 'embedpress'),
48 'type' => Controls_Manager::MEDIA,
49 'dynamic' => [
50 'active' => true,
51 ],
52 'classes' => $this->pro_class,
53 'condition' => $condition,
54 'default' => [
55 'url' => Helper::get_branding_value('logo_url', $provider_name)
56 ],
57 ]
58 );
59
60 $this->add_group_control(
61 Group_Control_Image_Size::get_type(),
62 [
63 'name' => "embedpress_pro_{$provider_name}_logo",
64 'default' => 'full',
65 'condition' => $logo_condition,
66 'classes' => $this->pro_class,
67 ]
68 );
69 $this->add_responsive_control(
70 "embedpress_pro_{$provider_name}_logo_xpos",
71 [
72 'label' => sprintf(__('Logo X Position %s', 'embedpress'), $this->pro_text),
73 'description' => __('Change this number to move your logo in horizontal direction.', 'embedpress'),
74 'type' => Controls_Manager::SLIDER,
75 'size_units' => ['px', '%'],
76 'range' => [
77 'px' => [
78 'min' => 0,
79 'max' => 1000,
80 'step' => 5,
81 ],
82 '%' => [
83 'min' => 0,
84 'max' => 100,
85 ],
86 ],
87 'default' => [
88 'unit' => '%',
89 'size' => 10,
90 ],
91 'selectors' => [
92 "{{WRAPPER}} .ose-{$provider_name} .watermark, {{WRAPPER}} .ep-embed-content-wraper .watermark" => 'right: {{SIZE}}{{UNIT}};',
93 ],
94 'condition' => $logo_condition,
95 'classes' => $this->pro_class,
96 ]
97 );
98 $this->add_responsive_control(
99 "embedpress_pro_{$provider_name}_logo_ypos",
100 [
101 'label' => sprintf(__('Logo Y Position %s', 'embedpress'), $this->pro_text),
102 'description' => __('Change this number to move your logo in vertical direction.', 'embedpress'),
103 'type' => Controls_Manager::SLIDER,
104 'size_units' => ['px', '%'],
105 'range' => [
106 'px' => [
107 'min' => 0,
108 'max' => 1000,
109 'step' => 5,
110 ],
111 '%' => [
112 'min' => 0,
113 'max' => 100,
114 ],
115 ],
116 'default' => [
117 'unit' => '%',
118 'size' => 10,
119 ],
120 'selectors' => [
121 "{{WRAPPER}} .ose-{$provider_name} .watermark, {{WRAPPER}} .ep-embed-content-wraper .watermark" => 'bottom: {{SIZE}}{{UNIT}};',
122 ],
123 'condition' => $logo_condition,
124 'classes' => $this->pro_class,
125
126 ]
127 );
128 $this->start_controls_tabs(
129 "ep_{$provider_name}_cta_style_tabs",
130 [
131 'condition' => $logo_condition,
132 ]
133 );
134 $this->start_controls_tab(
135 "ep_{$provider_name}_cta_normal_tab",
136 [
137 'label' => __('Normal', 'embedpress'),
138 ]
139 );
140 $this->add_control(
141 "embedpress_pro_{$provider_name}_logo_opacity",
142 [
143 'label' => sprintf(__('Logo Opacity %s', 'embedpress'), $this->pro_text),
144 'type' => Controls_Manager::SLIDER,
145 'default' => [
146 'size' => .5,
147 ],
148 'range' => [
149 'px' => [
150 'max' => 1,
151 'step' => 0.01,
152 ],
153 ],
154 'selectors' => [
155 "{{WRAPPER}} .ose-{$provider_name} .watermark, {{WRAPPER}} .ep-embed-content-wraper .watermark" => 'opacity: {{SIZE}}!important;',
156 ],
157 'condition' => $logo_condition,
158 'classes' => $this->pro_class,
159
160 ]
161 );
162 $this->end_controls_tab();
163 $this->start_controls_tab(
164 "ep_{$provider_name}_cta_hover__tab",
165 [
166 'label' => __('Hover', 'embedpress'),
167 ]
168 );
169 $this->add_control(
170 "embedpress_pro_{$provider_name}_logo_opacity_hover",
171 [
172 'label' => sprintf(__('Logo Opacity %s', 'embedpress'), $this->pro_text),
173 'type' => Controls_Manager::SLIDER,
174 'size_units' => ['%'],
175 'default' => [
176 'size' => 1,
177 ],
178 'range' => [
179 'px' => [
180 'max' => 1,
181 'step' => 0.01,
182 ],
183 ],
184 'selectors' => [
185 "{{WRAPPER}} .ose-{$provider_name} .watermark:hover, {{WRAPPER}} .ep-embed-content-wraper .watermark:hover" => 'opacity: {{SIZE}};',
186 ],
187 'condition' => $logo_condition,
188 'classes' => $this->pro_class,
189
190 ]
191 );
192 $this->end_controls_tab();
193 $this->end_controls_tabs();
194 $this->add_control(
195 "embedpress_pro_{$provider_name}_cta",
196 [
197 'label' => sprintf(__('CTA link for Logo %s', 'embedpress'), $this->pro_text),
198 'description' => __('You can show the logo inside a link. Leave it empty to hide it', 'embedpress'),
199 'type' => Controls_Manager::URL,
200 'dynamic' => [
201 'active' => true,
202 ],
203 'placeholder' => __('https://your-link.com', 'embedpress'),
204 'condition' => $logo_condition,
205 'classes' => $this->pro_class,
206 'separator' => 'before',
207 ]
208 );
209 }
210 }
211