Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/options/single-elements/post-nav.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + if (! isset($prefix)) {
4 + $prefix = '';
5 + } else {
6 + $prefix = $prefix . '_';
7 + }
8 +
9 + if (! isset($enabled)) {
10 + $enabled = 'no';
11 + }
12 +
13 + if (! isset($post_type)) {
14 + $post_type = 'post';
15 + }
16 +
17 + $options = [
18 + $prefix . 'has_post_nav' => [
19 + 'label' => __( 'Posts Navigation', 'blocksy' ),
20 + 'type' => 'ct-panel',
21 + 'switch' => true,
22 + 'value' => $enabled,
23 + 'sync' => blocksy_sync_single_post_container([
24 + 'prefix' => $prefix
25 + ]),
26 + 'inner-options' => [
27 +
28 + blocksy_rand_md5() => [
29 + 'title' => __( 'General', 'blocksy' ),
30 + 'type' => 'tab',
31 + 'options' => [
32 +
33 + $prefix . 'post_nav_criteria' => [
34 + 'label' => __( 'Navigation Criteria', 'blocksy' ),
35 + 'type' => 'ct-radio',
36 + 'value' => 'default',
37 + 'view' => 'text',
38 + 'design' => 'block',
39 + 'setting' => [ 'transport' => 'postMessage' ],
40 + 'choices' => [
41 + 'default' => __( 'Default', 'blocksy' ),
42 + 'taxonomy' => __( 'Taxonomy', 'blocksy' ),
43 + ],
44 + ],
45 +
46 + blocksy_rand_md5() => [
47 + 'type' => 'ct-condition',
48 + 'condition' => [ $prefix . 'post_nav_criteria' => 'taxonomy' ],
49 + 'options' => [
50 +
51 + $prefix . 'post_nav_taxonomy' => [
52 + 'label' => __( 'Taxonomy', 'blocksy' ),
53 + 'desc' => __( 'Navigate through posts that are from the same taxonomy.', 'blocksy' ),
54 + 'type' => 'ct-select',
55 + 'value' => array_keys(blocksy_get_taxonomies_for_cpt(
56 + $post_type
57 + ))[0],
58 + 'view' => 'text',
59 + 'design' => 'inline',
60 + 'choices' => blocksy_ordered_keys(
61 + blocksy_get_taxonomies_for_cpt($post_type)
62 + ),
63 + 'sync' => [
64 + 'prefix' => $prefix,
65 + 'selector' => '.post-navigation',
66 + 'render' => function () {
67 + echo blocksy_post_navigation();
68 + }
69 + ]
70 + ],
71 +
72 + ],
73 + ],
74 +
75 + $prefix . 'post_nav_spacing' => [
76 + 'label' => __( 'Container Spacing', 'blocksy' ),
77 + 'type' => 'ct-slider',
78 + 'value' => '50px',
79 + 'units' => blocksy_units_config([
80 + [ 'unit' => 'px', 'min' => 0, 'max' => 200],
81 + ['unit' => '', 'type' => 'custom'],
82 + ]),
83 + 'responsive' => true,
84 + 'sync' => 'live',
85 + 'divider' => 'top:bottom',
86 + ],
87 +
88 + $prefix . 'post_nav_thumb_size' => [
89 + 'label' => __('Image Size', 'blocksy'),
90 + 'type' => 'ct-select',
91 + 'value' => 'medium',
92 + 'view' => 'text',
93 + 'design' => 'inline',
94 + 'divider' => 'bottom',
95 + 'choices' => blocksy_ordered_keys(
96 + blocksy_get_all_image_sizes()
97 + ),
98 + 'sync' => [
99 + 'prefix' => $prefix,
100 + 'selector' => '.post-navigation',
101 + 'render' => function () {
102 + echo blocksy_post_navigation();
103 + }
104 + ]
105 + ],
106 +
107 + $prefix . 'post_nav_thumb_visibility' => [
108 + 'label' => __( 'Image Visibility', 'blocksy' ),
109 + 'type' => 'ct-visibility',
110 + 'design' => 'block',
111 + 'sync' => 'live',
112 + 'divider' => 'bottom',
113 + 'allow_empty' => true,
114 + 'value' => blocksy_default_responsive_value([
115 + 'desktop' => true,
116 + 'tablet' => true,
117 + 'mobile' => true,
118 + ]),
119 + 'choices' => blocksy_ordered_keys([
120 + 'desktop' => __( 'Desktop', 'blocksy' ),
121 + 'tablet' => __( 'Tablet', 'blocksy' ),
122 + 'mobile' => __( 'Mobile', 'blocksy' ),
123 + ]),
124 + ],
125 +
126 + $prefix . 'post_nav_title_visibility' => [
127 + 'label' => __( 'Title Visibility', 'blocksy' ),
128 + 'type' => 'ct-visibility',
129 + 'design' => 'block',
130 + 'sync' => 'live',
131 + 'divider' => 'bottom',
132 + 'allow_empty' => true,
133 + 'value' => blocksy_default_responsive_value([
134 + 'desktop' => true,
135 + 'tablet' => true,
136 + 'mobile' => false,
137 + ]),
138 + 'choices' => blocksy_ordered_keys([
139 + 'desktop' => __( 'Desktop', 'blocksy' ),
140 + 'tablet' => __( 'Tablet', 'blocksy' ),
141 + 'mobile' => __( 'Mobile', 'blocksy' ),
142 + ]),
143 + ],
144 +
145 + $prefix . 'post_nav_visibility' => [
146 + 'label' => __( 'Module Visibility', 'blocksy' ),
147 + 'type' => 'ct-visibility',
148 + 'design' => 'block',
149 + 'sync' => 'live',
150 + 'value' => blocksy_default_responsive_value([
151 + 'desktop' => true,
152 + 'tablet' => true,
153 + 'mobile' => true,
154 + ]),
155 + 'choices' => blocksy_ordered_keys([
156 + 'desktop' => __( 'Desktop', 'blocksy' ),
157 + 'tablet' => __( 'Tablet', 'blocksy' ),
158 + 'mobile' => __( 'Mobile', 'blocksy' ),
159 + ]),
160 + ],
161 +
162 + ],
163 + ],
164 +
165 + blocksy_rand_md5() => [
166 + 'title' => __( 'Design', 'blocksy' ),
167 + 'type' => 'tab',
168 + 'options' => [
169 +
170 + $prefix . 'posts_nav_font_color' => [
171 + 'label' => __( 'Font Color', 'blocksy' ),
172 + 'type' => 'ct-color-picker',
173 + 'design' => 'inline',
174 + 'sync' => 'live',
175 + 'value' => [
176 + 'default' => [
177 + 'color' => 'var(--theme-text-color)',
178 + ],
179 +
180 + 'hover' => [
181 + 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
182 + ],
183 + ],
184 + 'pickers' => [
185 + [
186 + 'title' => __( 'Initial', 'blocksy' ),
187 + 'id' => 'default',
188 + ],
189 +
190 + [
191 + 'title' => __( 'Hover', 'blocksy' ),
192 + 'id' => 'hover',
193 + 'inherit' => 'var(--theme-link-hover-color)'
194 + ],
195 + ],
196 + ],
197 +
198 + $prefix . 'posts_nav_image_overlay_color' => [
199 + 'label' => __( 'Thumbnail Overlay Color', 'blocksy' ),
200 + 'type' => 'ct-color-picker',
201 + 'design' => 'inline',
202 + 'sync' => 'live',
203 + 'divider' => 'top',
204 + 'value' => [
205 + 'hover' => [
206 + 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
207 + ],
208 + ],
209 + 'pickers' => [
210 + [
211 + 'title' => __( 'Hover', 'blocksy' ),
212 + 'id' => 'hover',
213 + 'inherit' => 'var(--theme-palette-color-1)'
214 + ],
215 + ],
216 + ],
217 +
218 + $prefix . 'posts_nav_image_border_radius' => [
219 + 'label' => __( 'Thumbnail Border Radius', 'blocksy' ),
220 + 'type' => 'ct-spacing',
221 + 'divider' => 'top',
222 + 'value' => blocksy_spacing_value(),
223 + 'inputAttr' => [
224 + 'placeholder' => '100'
225 + ],
226 + 'min' => 0,
227 + 'sync' => 'live',
228 + ],
229 +
230 + ],
231 + ],
232 +
233 + ],
234 + ],
235 +
236 + ];
237 +
238 +