Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/options/general/breadcrumbs.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + /**
4 + * Breadcrumbs options
5 + *
6 + * @copyright 2019-present Creative Themes
7 + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
8 + * @package Blocksy
9 + */
10 +
11 + $source_options = [
12 + 'default' => __('Default', 'blocksy')
13 + ];
14 +
15 + $is_shop = class_exists( 'woocommerce' );
16 + $is_pro = function_exists('blc_site_has_feature') && blc_site_has_feature();
17 +
18 + if (function_exists('rank_math_the_breadcrumbs')) {
19 + ob_start();
20 + rank_math_the_breadcrumbs();
21 + $content = ob_get_clean();
22 +
23 + if (! empty($content)) {
24 + $source_options['rankmath'] = __('RankMath', 'blocksy');
25 + }
26 + }
27 +
28 + if (function_exists('yoast_breadcrumb')) {
29 + ob_start();
30 + yoast_breadcrumb('<div>', '</div>');
31 + $content = ob_get_clean();
32 +
33 + if (! empty($content)) {
34 + $source_options['yoast'] = __('Yoast', 'blocksy');
35 + }
36 + }
37 +
38 + if (function_exists('seopress_display_breadcrumbs')) {
39 + $source_options['seopress'] = __('SeoPress', 'blocksy');
40 + }
41 +
42 + if (function_exists('bcn_display')) {
43 + $source_options['bcnxt'] = __('Breadcrumb NavXT', 'blocksy');
44 + }
45 +
46 + if (class_exists('\SlimSEO\Breadcrumbs')) {
47 + $source_options['slimseo'] = __('SlimSEO', 'blocksy');
48 + }
49 +
50 + $breadcrumbs_options = [
51 + blocksy_rand_md5() => [
52 + 'title' => __( 'General', 'blocksy' ),
53 + 'type' => 'tab',
54 + 'options' => [
55 +
56 + $is_pro ? [
57 + 'breadcrumb_separator_icon_source' => [
58 + 'label' => __('Separator Icon Source', 'blocksy'),
59 + 'type' => 'ct-radio',
60 + 'value' => 'default',
61 + 'view' => 'text',
62 + 'design' => 'block',
63 + 'divider' => 'bottom',
64 + 'choices' => [
65 + 'default' => __('Default', 'blocksy'),
66 + 'custom' => __('Custom', 'blocksy'),
67 + ],
68 + 'sync' => blocksy_sync_whole_page([
69 + 'loader_selector' => '.ct-breadcrumbs'
70 + ]),
71 + ],
72 + ] : [],
73 +
74 + blocksy_rand_md5() => [
75 + 'type' => 'ct-condition',
76 + 'condition' => $is_pro
77 + ? [
78 + 'breadcrumb_separator_icon_source' => 'default',
79 + ]
80 + : [
81 + 'breadcrumb_separator_icon_source' => '! not_existing',
82 + ],
83 + 'options' => [
84 + 'breadcrumb_separator' => [
85 + 'label' => __('Separator Icon', 'blocksy'),
86 + 'type' => 'ct-image-picker',
87 + 'value' => 'type-1',
88 + 'attr' => [ 'data-columns' => '3' ],
89 + 'choices' => [
90 + 'type-1' => [
91 + 'src' => blocksy_image_picker_file( 'breadcrumb-sep-1' ),
92 + 'title' => __( 'Type 1', 'blocksy' ),
93 + ],
94 +
95 + 'type-2' => [
96 + 'src' => blocksy_image_picker_file( 'breadcrumb-sep-2' ),
97 + 'title' => __( 'Type 2', 'blocksy' ),
98 + ],
99 +
100 + 'type-3' => [
101 + 'src' => blocksy_image_picker_file( 'breadcrumb-sep-3' ),
102 + 'title' => __( 'Type 3', 'blocksy' ),
103 + ],
104 + ],
105 + 'sync' => blocksy_sync_whole_page([
106 + 'loader_selector' => '.ct-breadcrumbs'
107 + ]),
108 + ],
109 + ],
110 + ],
111 +
112 + $is_pro ? [
113 + blocksy_rand_md5() => [
114 + 'type' => 'ct-condition',
115 + 'condition' => ['breadcrumb_separator_icon_source' => 'custom'],
116 + 'options' => [
117 +
118 + 'breadcrumb_custom_separator' => [
119 + 'type' => 'icon-picker',
120 + 'label' => __('Icon', 'blocksy'),
121 + 'design' => 'inline',
122 + 'value' => [
123 + 'icon' => 'blc blc-arrow-right',
124 + ],
125 + 'sync' => blocksy_sync_whole_page([
126 + 'loader_selector' => '.ct-breadcrumbs'
127 + ]),
128 + ],
129 +
130 + 'breadcrumbs_separator_size' => [
131 + 'label' => __( 'Icon Size', 'blocksy' ),
132 + 'type' => 'ct-slider',
133 + 'min' => 5,
134 + 'max' => 50,
135 + 'value' => 8,
136 + 'responsive' => true,
137 + 'divider' => 'top',
138 + 'setting' => [ 'transport' => 'postMessage' ],
139 + ],
140 + ],
141 + ],
142 + ] : [],
143 +
144 + 'breadcrumb_home_item' => [
145 + 'label' => __('Home Item', 'blocksy'),
146 + 'type' => 'ct-radio',
147 + 'value' => 'text',
148 + 'view' => 'text',
149 + 'divider' => 'top:full',
150 + 'choices' => [
151 + 'text' => __('Text', 'blocksy'),
152 + 'icon' => __('Icon', 'blocksy'),
153 + ],
154 + 'sync' => blocksy_sync_whole_page([
155 + 'loader_selector' => '.ct-breadcrumbs'
156 + ]),
157 + ],
158 +
159 + blocksy_rand_md5() => [
160 + 'type' => 'ct-condition',
161 + 'condition' => [ 'breadcrumb_home_item' => 'text' ],
162 + 'options' => [
163 +
164 + 'breadcrumb_home_text' => [
165 + 'label' => __( 'Home Page Text', 'blocksy' ),
166 + 'type' => 'text',
167 + 'design' => 'block',
168 + 'value' => __( 'Home', 'blocksy' ),
169 + 'sync' => blocksy_sync_whole_page([
170 + 'loader_selector' => '.ct-breadcrumbs'
171 + ]),
172 + ],
173 +
174 + ],
175 + ],
176 +
177 + blocksy_rand_md5() => [
178 + 'type' => 'ct-condition',
179 + 'condition' => [ 'breadcrumb_home_item' => 'icon' ],
180 + 'options' => $is_pro ? [
181 +
182 + 'breadcrumb_home_icon' => [
183 + 'type' => 'icon-picker',
184 + 'label' => __(
185 + 'Icon',
186 + 'blocksy'
187 + ),
188 + 'design' => 'inline',
189 + 'divider' => 'top',
190 + 'value' => [
191 + 'icon' => 'blc blc-home-alt',
192 + ],
193 + 'sync' => blocksy_sync_whole_page([
194 + 'loader_selector' => '.ct-breadcrumbs'
195 + ]),
196 + ],
197 +
198 + 'breadcrumbs_home_icon_size' => [
199 + 'label' => __( 'Icon Size', 'blocksy' ),
200 + 'type' => 'ct-slider',
201 + 'min' => 5,
202 + 'max' => 50,
203 + 'value' => 15,
204 + 'responsive' => true,
205 + 'divider' => 'top',
206 + 'setting' => [ 'transport' => 'postMessage' ],
207 + ],
208 + ] : []
209 + ],
210 +
211 + 'breadcrumb_page_title' => [
212 + 'label' => __( 'Single Page/Post Title', 'blocksy' ),
213 + 'type' => 'ct-switch',
214 + 'value' => 'yes',
215 + 'divider' => 'top:full',
216 + 'sync' => blocksy_sync_whole_page([
217 + 'loader_selector' => '.ct-breadcrumbs'
218 + ]),
219 + ],
220 +
221 + 'breadcrumb_single_taxonomy_title' => [
222 + 'label' => __( 'Single Page/Post Taxonomy Title', 'blocksy' ),
223 + 'type' => 'ct-switch',
224 + 'value' => 'yes',
225 + 'divider' => 'top:full',
226 + 'sync' => blocksy_sync_whole_page([
227 + 'loader_selector' => '.ct-breadcrumbs'
228 + ]),
229 + ],
230 +
231 + 'breadcrumb_taxonomy_title' => [
232 + 'label' => __( 'Archive Taxonomy Title', 'blocksy' ),
233 + 'type' => 'ct-switch',
234 + 'value' => 'yes',
235 + 'sync' => blocksy_sync_whole_page([
236 + 'loader_selector' => '.ct-breadcrumbs'
237 + ]),
238 + ],
239 +
240 + blocksy_rand_md5() => [
241 + 'type' => 'ct-condition',
242 + 'condition' => ['show_on_front' => '!posts'],
243 + 'values_source' => 'global',
244 + 'options' => [
245 + 'breadcrumb_blog_item' => [
246 + 'label' => __('Blog Page in Breadcrumbs', 'blocksy'),
247 + 'type' => 'ct-switch',
248 + 'value' => 'no',
249 + 'sync' => blocksy_sync_whole_page([
250 + 'loader_selector' => '.ct-breadcrumbs'
251 + ]),
252 + ],
253 + ]
254 + ],
255 +
256 + blocksy_rand_md5() => [
257 + 'options' => $is_shop ? [
258 + 'breadcrumb_shop_item' => [
259 + 'label' => __('Shop Page in Breadcrumbs', 'blocksy'),
260 + 'type' => 'ct-switch',
261 + 'value' => 'no',
262 + 'sync' => blocksy_sync_whole_page([
263 + 'loader_selector' => '.ct-breadcrumbs'
264 + ]),
265 + ]
266 + ] : []
267 + ],
268 +
269 + ],
270 + ],
271 +
272 + blocksy_rand_md5() => [
273 + 'title' => __( 'Design', 'blocksy' ),
274 + 'type' => 'tab',
275 + 'options' => [
276 +
277 + 'breadcrumbsFont' => [
278 + 'type' => 'ct-typography',
279 + 'label' => __( 'Breadcrumbs Font', 'blocksy' ),
280 + 'value' => blocksy_typography_default_values([
281 + 'size' => '12px',
282 + 'variation' => 'n6',
283 + 'text-transform' => 'uppercase',
284 + ]),
285 + 'design' => 'block',
286 + 'sync' => 'live',
287 + 'divider' => 'top:full',
288 + ],
289 +
290 + 'breadcrumbsFontColor' => [
291 + 'label' => __( 'Breadcrumbs Font Color', 'blocksy' ),
292 + 'type' => 'ct-color-picker',
293 + 'design' => 'inline',
294 + 'sync' => 'live',
295 +
296 + 'value' => [
297 + 'default' => [
298 + 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
299 + ],
300 +
301 + 'initial' => [
302 + 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
303 + ],
304 +
305 + 'hover' => [
306 + 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
307 + ],
308 + ],
309 +
310 + 'pickers' => [
311 + [
312 + 'title' => __( 'Text', 'blocksy' ),
313 + 'id' => 'default',
314 + 'inherit' => 'var(--theme-text-color)'
315 + ],
316 +
317 + [
318 + 'title' => __( 'Link Initial', 'blocksy' ),
319 + 'id' => 'initial',
320 + 'inherit' => 'var(--theme-link-initial-color)'
321 + ],
322 +
323 + [
324 + 'title' => __( 'Link Hover', 'blocksy' ),
325 + 'id' => 'hover',
326 + 'inherit' => 'var(--theme-link-hover-color)'
327 + ],
328 + ],
329 + ],
330 +
331 + ],
332 + ],
333 + ];
334 +
335 + $options = [
336 +
337 + 'breadcrumbs_panel' => [
338 + 'label' => __( 'Breadcrumbs', 'blocksy' ),
339 + 'type' => 'ct-panel',
340 + 'setting' => [ 'transport' => 'postMessage' ],
341 + 'inner-options' => array_merge(count($source_options) > 1 ? [
342 + 'breadcrumbs_source' => [
343 + 'label' => __('Breadcrumbs Source', 'blocksy'),
344 + 'type' => 'ct-select',
345 + 'value' => 'default',
346 + 'choices' => $source_options,
347 + 'divider' => 'bottom:full'
348 + ],
349 +
350 + blocksy_rand_md5() => [
351 + 'type' => 'ct-condition',
352 + 'condition' => [
353 + 'breadcrumbs_source' => 'default'
354 + ],
355 + 'options' => $breadcrumbs_options
356 + ]
357 + ] : $breadcrumbs_options)
358 + ],
359 +
360 + ];
361 +