PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.3.2
GenerateBlocks v1.3.2
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / includes / defaults.php
generateblocks / includes Last commit date
class-do-css.php 5 years ago class-enqueue-css.php 5 years ago class-plugin-update.php 5 years ago class-render-blocks.php 5 years ago class-rest.php 5 years ago class-settings.php 5 years ago dashboard.php 5 years ago defaults.php 5 years ago functions.php 5 years ago general.php 5 years ago generate-css.php 5 years ago
defaults.php
554 lines
1 <?php
2 /**
3 * Set our block attribute defaults.
4 *
5 * @package GenerateBlocks
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 /**
13 * Set our block defaults.
14 *
15 * @since 0.1
16 *
17 * @return array
18 */
19 function generateblocks_get_block_defaults() {
20 $defaults = array();
21
22 $container_width = 1100;
23
24 if ( function_exists( 'generate_get_option' ) ) {
25 $container_width = generate_get_option( 'container_width' );
26 }
27
28 $defaults['container'] = array(
29 'tagName' => 'div',
30 'isGrid' => false,
31 'containerWidth' => $container_width,
32 'outerContainer' => 'full',
33 'innerContainer' => 'contained',
34 'minHeight' => false,
35 'minHeightUnit' => 'px',
36 'minHeightTablet' => false,
37 'minHeightUnitTablet' => 'px',
38 'minHeightMobile' => false,
39 'minHeightUnitMobile' => 'px',
40 'paddingTop' => 40,
41 'paddingRight' => 40,
42 'paddingBottom' => 40,
43 'paddingLeft' => 40,
44 'paddingUnit' => 'px',
45 'paddingTopTablet' => '',
46 'paddingRightTablet' => '',
47 'paddingBottomTablet' => '',
48 'paddingLeftTablet' => '',
49 'paddingTopMobile' => '',
50 'paddingRightMobile' => '',
51 'paddingBottomMobile' => '',
52 'paddingLeftMobile' => '',
53 'marginTop' => '',
54 'marginRight' => '',
55 'marginBottom' => '',
56 'marginLeft' => '',
57 'marginUnit' => 'px',
58 'marginTopTablet' => '',
59 'marginRightTablet' => '',
60 'marginBottomTablet' => '',
61 'marginLeftTablet' => '',
62 'marginTopMobile' => '',
63 'marginRightMobile' => '',
64 'marginBottomMobile' => '',
65 'marginLeftMobile' => '',
66 'borderSizeTop' => '',
67 'borderSizeRight' => '',
68 'borderSizeBottom' => '',
69 'borderSizeLeft' => '',
70 'borderSizeTopTablet' => '',
71 'borderSizeRightTablet' => '',
72 'borderSizeBottomTablet' => '',
73 'borderSizeLeftTablet' => '',
74 'borderSizeTopMobile' => '',
75 'borderSizeRightMobile' => '',
76 'borderSizeBottomMobile' => '',
77 'borderSizeLeftMobile' => '',
78 'borderRadiusTopRight' => '',
79 'borderRadiusBottomRight' => '',
80 'borderRadiusBottomLeft' => '',
81 'borderRadiusTopLeft' => '',
82 'borderRadiusUnit' => 'px',
83 'borderRadiusTopRightTablet' => '',
84 'borderRadiusBottomRightTablet' => '',
85 'borderRadiusBottomLeftTablet' => '',
86 'borderRadiusTopLeftTablet' => '',
87 'borderRadiusTopRightMobile' => '',
88 'borderRadiusBottomRightMobile' => '',
89 'borderRadiusBottomLeftMobile' => '',
90 'borderRadiusTopLeftMobile' => '',
91 'borderColor' => '',
92 'borderColorOpacity' => 1,
93 'backgroundColor' => '',
94 'backgroundColorOpacity' => 1,
95 'gradient' => false,
96 'gradientDirection' => 90,
97 'gradientColorOne' => '#ffffff',
98 'gradientColorOneOpacity' => 0.1,
99 'gradientColorStopOne' => '',
100 'gradientColorTwo' => '#000000',
101 'gradientColorTwoOpacity' => 0.3,
102 'gradientColorStopTwo' => '',
103 'gradientSelector' => 'element',
104 'textColor' => '',
105 'linkColor' => '',
106 'linkColorHover' => '',
107 'bgImage' => '',
108 'bgOptions' => array(
109 'selector' => 'element',
110 'opacity' => 1,
111 'overlay' => false,
112 'position' => 'center center',
113 'size' => 'cover',
114 'repeat' => 'no-repeat',
115 'attachment' => '',
116 ),
117 'bgImageSize' => 'full',
118 'width' => 50,
119 'widthTablet' => '',
120 'widthMobile' => 100,
121 'verticalAlignment' => '',
122 'verticalAlignmentTablet' => 'inherit',
123 'verticalAlignmentMobile' => 'inherit',
124 'zindex' => '',
125 'innerZindex' => '',
126 'removeVerticalGap' => false,
127 'removeVerticalGapTablet' => false,
128 'removeVerticalGapMobile' => false,
129 'orderTablet' => false,
130 'orderMobile' => false,
131 'alignment' => '',
132 'alignmentTablet' => '',
133 'alignmentMobile' => '',
134 'showAdvancedTypography' => false,
135 'fontFamily' => '',
136 'fontFamilyFallback' => '',
137 'googleFont' => false,
138 'googleFontVariants' => '',
139 'fontWeight' => '',
140 'fontSize' => '',
141 'fontSizeTablet' => '',
142 'fontSizeMobile' => '',
143 'fontSizeUnit' => 'px',
144 'textTransform' => '',
145 );
146
147 $defaults['buttonContainer'] = array(
148 'alignment' => '',
149 'alignmentTablet' => '',
150 'alignmentMobile' => '',
151 'marginTop' => '',
152 'marginRight' => '',
153 'marginBottom' => '',
154 'marginLeft' => '',
155 'marginTopTablet' => '',
156 'marginRightTablet' => '',
157 'marginBottomTablet' => '',
158 'marginLeftTablet' => '',
159 'marginTopMobile' => '',
160 'marginRightMobile' => '',
161 'marginBottomMobile' => '',
162 'marginLeftMobile' => '',
163 'marginUnit' => 'px',
164 'stack' => false,
165 'stackTablet' => false,
166 'stackMobile' => false,
167 'fillHorizontalSpace' => false,
168 'fillHorizontalSpaceTablet' => false,
169 'fillHorizontalSpaceMobile' => false,
170 );
171
172 $defaults['button'] = array(
173 'backgroundColor' => false,
174 'backgroundColorOpacity' => 1,
175 'textColor' => false,
176 'backgroundColorHover' => false,
177 'backgroundColorHoverOpacity' => 1,
178 'textColorHover' => false,
179 'showAdvancedTypography' => false,
180 'fontFamily' => '',
181 'fontFamilyFallback' => '',
182 'googleFont' => false,
183 'googleFontVariants' => '',
184 'fontWeight' => '',
185 'fontSize' => false,
186 'fontSizeTablet' => false,
187 'fontSizeMobile' => false,
188 'fontSizeUnit' => 'px',
189 'textTransform' => '',
190 'letterSpacing' => '',
191 'letterSpacingTablet' => '',
192 'letterSpacingMobile' => '',
193 'marginTop' => '',
194 'marginRight' => '',
195 'marginBottom' => '',
196 'marginLeft' => '',
197 'marginTopTablet' => '',
198 'marginRightTablet' => '',
199 'marginBottomTablet' => '',
200 'marginLeftTablet' => '',
201 'marginTopMobile' => '',
202 'marginRightMobile' => '',
203 'marginBottomMobile' => '',
204 'marginLeftMobile' => '',
205 'marginUnit' => 'px',
206 'paddingTop' => '',
207 'paddingRight' => '',
208 'paddingBottom' => '',
209 'paddingLeft' => '',
210 'paddingTopTablet' => '',
211 'paddingRightTablet' => '',
212 'paddingBottomTablet' => '',
213 'paddingLeftTablet' => '',
214 'paddingTopMobile' => '',
215 'paddingRightMobile' => '',
216 'paddingBottomMobile' => '',
217 'paddingLeftMobile' => '',
218 'paddingUnit' => 'px',
219 'borderSizeTop' => '',
220 'borderSizeRight' => '',
221 'borderSizeBottom' => '',
222 'borderSizeLeft' => '',
223 'borderSizeTopTablet' => '',
224 'borderSizeRightTablet' => '',
225 'borderSizeBottomTablet' => '',
226 'borderSizeLeftTablet' => '',
227 'borderSizeTopMobile' => '',
228 'borderSizeRightMobile' => '',
229 'borderSizeBottomMobile' => '',
230 'borderSizeLeftMobile' => '',
231 'borderRadiusTopRight' => '',
232 'borderRadiusBottomRight' => '',
233 'borderRadiusBottomLeft' => '',
234 'borderRadiusTopLeft' => '',
235 'borderRadiusTopRightTablet' => '',
236 'borderRadiusBottomRightTablet' => '',
237 'borderRadiusBottomLeftTablet' => '',
238 'borderRadiusTopLeftTablet' => '',
239 'borderRadiusTopRightMobile' => '',
240 'borderRadiusBottomRightMobile' => '',
241 'borderRadiusBottomLeftMobile' => '',
242 'borderRadiusTopLeftMobile' => '',
243 'borderRadiusUnit' => 'px',
244 'borderColor' => false,
245 'borderColorOpacity' => 1,
246 'borderColorHover' => false,
247 'borderColorHoverOpacity' => 1,
248 'icon' => '',
249 'hasIcon' => false,
250 'iconLocation' => 'left',
251 'removeText' => false,
252 'ariaLabel' => '',
253 'gradient' => false,
254 'gradientDirection' => 90,
255 'gradientColorOne' => '#ffffff',
256 'gradientColorOneOpacity' => 0.1,
257 'gradientColorStopOne' => '',
258 'gradientColorTwo' => '#000000',
259 'gradientColorTwoOpacity' => 0.3,
260 'gradientColorStopTwo' => '',
261 'iconPaddingTop' => '',
262 'iconPaddingRight' => '0.5',
263 'iconPaddingBottom' => '',
264 'iconPaddingLeft' => '',
265 'iconPaddingTopTablet' => '',
266 'iconPaddingRightTablet' => '',
267 'iconPaddingBottomTablet' => '',
268 'iconPaddingLeftTablet' => '',
269 'iconPaddingTopMobile' => '',
270 'iconPaddingRightMobile' => '',
271 'iconPaddingBottomMobile' => '',
272 'iconPaddingLeftMobile' => '',
273 'iconPaddingUnit' => 'em',
274 'iconSize' => 1,
275 'iconSizeTablet' => '',
276 'iconSizeMobile' => '',
277 'iconSizeUnit' => 'em',
278 );
279
280 $defaults['gridContainer'] = array(
281 'horizontalGap' => 30,
282 'verticalGap' => '',
283 'verticalAlignment' => '',
284 'horizontalGapTablet' => '',
285 'verticalGapTablet' => '',
286 'verticalAlignmentTablet' => 'inherit',
287 'horizontalGapMobile' => '',
288 'verticalGapMobile' => '',
289 'verticalAlignmentMobile' => 'inherit',
290 'horizontalAlignment' => '',
291 'horizontalAlignmentTablet' => '',
292 'horizontalAlignmentMobile' => '',
293 );
294
295 $defaults['headline'] = array(
296 'element' => 'h2',
297 'cssClasses' => '',
298 'alignment' => false,
299 'alignmentTablet' => false,
300 'alignmentMobile' => false,
301 'backgroundColor' => false,
302 'backgroundColorOpacity' => 1,
303 'textColor' => false,
304 'linkColor' => false,
305 'linkColorHover' => false,
306 'borderColor' => false,
307 'borderColorOpacity' => 1,
308 'highlightTextColor' => false,
309 'showAdvancedTypography' => false,
310 'fontFamily' => '',
311 'fontFamilyFallback' => '',
312 'googleFont' => false,
313 'googleFontVariants' => '',
314 'fontWeight' => '',
315 'fontSize' => '',
316 'fontSizeTablet' => '',
317 'fontSizeMobile' => '',
318 'fontSizeUnit' => 'px',
319 'textTransform' => '',
320 'lineHeight' => '',
321 'lineHeightTablet' => '',
322 'lineHeightMobile' => '',
323 'lineHeightUnit' => 'em',
324 'letterSpacing' => '',
325 'letterSpacingTablet' => '',
326 'letterSpacingMobile' => '',
327 'marginTop' => '',
328 'marginRight' => '',
329 'marginBottom' => '',
330 'marginLeft' => '',
331 'marginTopTablet' => '',
332 'marginRightTablet' => '',
333 'marginBottomTablet' => '',
334 'marginLeftTablet' => '',
335 'marginTopMobile' => '',
336 'marginRightMobile' => '',
337 'marginBottomMobile' => '',
338 'marginLeftMobile' => '',
339 'marginUnit' => 'px',
340 'paddingTop' => '',
341 'paddingRight' => '',
342 'paddingBottom' => '',
343 'paddingLeft' => '',
344 'paddingTopTablet' => '',
345 'paddingRightTablet' => '',
346 'paddingBottomTablet' => '',
347 'paddingLeftTablet' => '',
348 'paddingTopMobile' => '',
349 'paddingRightMobile' => '',
350 'paddingBottomMobile' => '',
351 'paddingLeftMobile' => '',
352 'paddingUnit' => 'px',
353 'borderSizeTop' => '',
354 'borderSizeRight' => '',
355 'borderSizeBottom' => '',
356 'borderSizeLeft' => '',
357 'borderSizeTopTablet' => '',
358 'borderSizeRightTablet' => '',
359 'borderSizeBottomTablet' => '',
360 'borderSizeLeftTablet' => '',
361 'borderSizeTopMobile' => '',
362 'borderSizeRightMobile' => '',
363 'borderSizeBottomMobile' => '',
364 'borderSizeLeftMobile' => '',
365 'borderRadiusTopRight' => '',
366 'borderRadiusBottomRight' => '',
367 'borderRadiusBottomLeft' => '',
368 'borderRadiusTopLeft' => '',
369 'borderRadiusTopRightTablet' => '',
370 'borderRadiusBottomRightTablet' => '',
371 'borderRadiusBottomLeftTablet' => '',
372 'borderRadiusTopLeftTablet' => '',
373 'borderRadiusTopRightMobile' => '',
374 'borderRadiusBottomRightMobile' => '',
375 'borderRadiusBottomLeftMobile' => '',
376 'borderRadiusTopLeftMobile' => '',
377 'borderRadiusUnit' => 'px',
378 'icon' => '',
379 'hasIcon' => false,
380 'iconColor' => false,
381 'iconColorOpacity' => 1,
382 'iconLocation' => 'inline',
383 'iconLocationTablet' => '',
384 'iconLocationMobile' => '',
385 'iconVerticalAlignment' => 'center',
386 'iconVerticalAlignmentTablet' => '',
387 'iconVerticalAlignmentMobile' => '',
388 'iconPaddingTop' => '',
389 'iconPaddingRight' => '0.5',
390 'iconPaddingBottom' => '',
391 'iconPaddingLeft' => '',
392 'iconPaddingTopTablet' => '',
393 'iconPaddingRightTablet' => '',
394 'iconPaddingBottomTablet' => '',
395 'iconPaddingLeftTablet' => '',
396 'iconPaddingTopMobile' => '',
397 'iconPaddingRightMobile' => '',
398 'iconPaddingBottomMobile' => '',
399 'iconPaddingLeftMobile' => '',
400 'iconPaddingUnit' => 'em',
401 'iconSize' => 1,
402 'iconSizeTablet' => '',
403 'iconSizeMobile' => '',
404 'iconSizeUnit' => 'em',
405 'inlineWidth' => false,
406 'inlineWidthTablet' => false,
407 'inlineWidthMobile' => false,
408 'removeText' => false,
409 'ariaLabel' => '',
410 );
411
412 return apply_filters( 'generateblocks_defaults', $defaults );
413 }
414
415 /**
416 * Get defaults for our general options.
417 *
418 * @since 0.1
419 */
420 function generateblocks_get_option_defaults() {
421 return apply_filters(
422 'generateblocks_option_defaults',
423 array(
424 'css_print_method' => 'file',
425 'sync_responsive_previews' => true,
426 )
427 );
428 }
429
430 /**
431 * Styles to use in the editor/font-end when needed.
432 *
433 * @since 1.0
434 */
435 function generateblocks_get_default_styles() {
436 $defaults = generateblocks_get_block_defaults();
437
438 $defaultBlockStyles = array(
439 'button' => array(
440 'backgroundColor' => $defaults['button']['backgroundColor'] ? $defaults['button']['backgroundColor'] : '#0366d6',
441 'textColor' => $defaults['button']['textColor'] ? $defaults['button']['textColor'] : '#ffffff',
442 'backgroundColorHover' => $defaults['button']['backgroundColorHover'] ? $defaults['button']['backgroundColorHover'] : '#222222',
443 'textColorHover' => $defaults['button']['textColorHover'] ? $defaults['button']['textColorHover'] : '#ffffff',
444 'paddingTop' => $defaults['button']['paddingTop'] ? $defaults['button']['paddingTop'] : '15',
445 'paddingRight' => $defaults['button']['paddingRight'] ? $defaults['button']['paddingRight'] : '20',
446 'paddingBottom' => $defaults['button']['paddingBottom'] ? $defaults['button']['paddingBottom'] : '15',
447 'paddingLeft' => $defaults['button']['paddingLeft'] ? $defaults['button']['paddingLeft'] : '20',
448 ),
449 'container' => array(
450 'gridItemPaddingTop' => '0',
451 'gridItemPaddingRight' => '0',
452 'gridItemPaddingBottom' => '0',
453 'gridItemPaddingLeft' => '0',
454 'bgImageSize' => 'full',
455 'shapeDividers' => array(
456 'shape' => 'gb-waves-1',
457 'location' => 'bottom',
458 'height' => 200,
459 'heightTablet' => '',
460 'heightMobile' => '',
461 'width' => 100,
462 'widthTablet' => '',
463 'widthMobile' => '',
464 'flipHorizontally' => false,
465 'zindex' => '',
466 'color' => '#000000',
467 'colorOpacity' => 1,
468 ),
469 ),
470 );
471
472 if ( function_exists( 'generate_get_default_fonts' ) ) {
473 $font_settings = wp_parse_args(
474 get_option( 'generate_settings', array() ),
475 generate_get_default_fonts()
476 );
477
478 $defaultBlockStyles['headline'] = array(
479 'p' => array(
480 'marginBottom' => $font_settings['paragraph_margin'],
481 'marginBottomTablet' => '',
482 'marginBottomMobile' => '',
483 'marginUnit' => 'em',
484 'fontSize' => $font_settings['body_font_size'],
485 'fontSizeTablet' => '',
486 'fontSizeMobile' => '',
487 'fontSizeUnit' => 'px',
488 ),
489 'h1' => array(
490 'marginBottom' => $font_settings['heading_1_margin_bottom'],
491 'marginBottomTablet' => '',
492 'marginBottomMobile' => '',
493 'marginUnit' => 'px',
494 'fontSize' => $font_settings['heading_1_font_size'],
495 'fontSizeTablet' => '',
496 'fontSizeMobile' => $font_settings['mobile_heading_1_font_size'],
497 'fontSizeUnit' => 'px',
498 ),
499 'h2' => array(
500 'marginBottom' => $font_settings['heading_2_margin_bottom'],
501 'marginBottomTablet' => '',
502 'marginBottomMobile' => '',
503 'marginUnit' => 'px',
504 'fontSize' => $font_settings['heading_2_font_size'],
505 'fontSizeTablet' => '',
506 'fontSizeMobile' => $font_settings['mobile_heading_1_font_size'],
507 'fontSizeUnit' => 'px',
508 ),
509 'h3' => array(
510 'marginBottom' => $font_settings['heading_3_margin_bottom'],
511 'marginBottomTablet' => '',
512 'marginBottomMobile' => '',
513 'marginUnit' => 'px',
514 'fontSize' => $font_settings['heading_3_font_size'],
515 'fontSizeTablet' => '',
516 'fontSizeMobile' => '',
517 'fontSizeUnit' => 'px',
518 ),
519 'h4' => array(
520 'marginBottom' => '20',
521 'marginBottomTablet' => '',
522 'marginBottomMobile' => '',
523 'marginUnit' => 'px',
524 'fontSize' => '',
525 'fontSizeTablet' => '',
526 'fontSizeMobile' => '',
527 'fontSizeUnit' => 'px',
528 ),
529 'h5' => array(
530 'marginBottom' => '20',
531 'marginBottomTablet' => '',
532 'marginBottomMobile' => '',
533 'marginUnit' => 'px',
534 'fontSize' => '',
535 'fontSizeTablet' => '',
536 'fontSizeMobile' => '',
537 'fontSizeUnit' => 'px',
538 ),
539 'h6' => array(
540 'marginBottom' => '20',
541 'marginBottomTablet' => '',
542 'marginBottomMobile' => '',
543 'marginUnit' => 'px',
544 'fontSize' => '',
545 'fontSizeTablet' => '',
546 'fontSizeMobile' => '',
547 'fontSizeUnit' => 'px',
548 ),
549 );
550 }
551
552 return apply_filters( 'generateblocks_default_block_styles', $defaultBlockStyles );
553 }
554