PluginProbe
Qi Blocks / trunk
Qi Blocks vtrunk
1.5.3 1.5.2 1.5.1 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.1.2 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 All 45 releases
← All changes | helpers/helper.php +538 -450 1.0.7trunk View file →
@@ -1,8 +1,10 @@
1 1 <?php
2 2
3 -// Exit if accessed directly.
4 -defined( 'ABSPATH' ) || exit;
3 +if ( ! defined( 'ABSPATH' ) ) {
4 + // Exit if accessed directly.
5 + exit;
6 +}
5 7
6 8 if ( ! function_exists( 'qi_blocks_extend_block_categories' ) ) {
7 9 /**
8 10 * Function that extend default array of block categories
@@ -47,9 +49,9 @@
47 49 'data' => $data,
48 50 'redirect' => ! empty( $redirect ) ? esc_url( $redirect ) : '',
49 51 );
50 52
51 - $output = json_encode( $response );
53 + $output = wp_json_encode( $response );
52 54
53 55 exit( $output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
54 56 }
55 57 }
@@ -77,8 +79,10 @@
77 79 case 'wp_forms':
78 80 return defined( 'WPFORMS_VERSION' );
79 81 case 'full_site_editing':
80 82 return get_theme_support( 'block-templates' );
83 + case 'wpml':
84 + return defined( 'ICL_SITEPRESS_VERSION' );
81 85 default:
82 86 return apply_filters( 'qi_blocks_is_plugin_installed', false, $plugin );
83 87
84 88 endswitch;
@@ -95,11 +99,11 @@
95 99 * @return string - template html
96 100 */
97 101 function qi_blocks_execute_template_with_params( $template, $params ) {
98 102 if ( ! empty( $template ) && file_exists( $template ) ) {
99 - // Extract params so they could be used in template
103 + // Extract params so they could be used in template.
100 104 if ( is_array( $params ) && count( $params ) ) {
101 - extract( $params ); // @codingStandardsIgnoreLine
105 + extract( $params, EXTR_SKIP ); // @codingStandardsIgnoreLine
102 106 }
103 107
104 108 ob_start();
105 109 include $template;
@@ -111,8 +115,29 @@
111 115 }
112 116 }
113 117 }
114 118
119 +if ( ! function_exists( 'qi_blocks_sanitize_module_template_part' ) ) {
120 + /**
121 + * Sanitize module template part.
122 + *
123 + * @param string $template temp path to file that is being loaded
124 + *
125 + * @return string - string with template path
126 + */
127 + function qi_blocks_sanitize_module_template_part( $template ) {
128 + $available_characters = '/[^A-Za-z0-9\_\-\/]/';
129 +
130 + if ( ! empty( $template ) && is_scalar( $template ) ) {
131 + $template = preg_replace( $available_characters, '', $template );
132 + } else {
133 + $template = '';
134 + }
135 +
136 + return $template;
137 + }
138 +}
139 +
115 140 if ( ! function_exists( 'qi_blocks_get_template_with_slug' ) ) {
116 141 /**
117 142 * Loads module template part.
118 143 *
@@ -124,8 +149,10 @@
124 149 function qi_blocks_get_template_with_slug( $temp, $slug ) {
125 150 $template = '';
126 151
127 152 if ( ! empty( $temp ) ) {
153 + $slug = qi_blocks_sanitize_module_template_part( $slug );
154 +
128 155 if ( ! empty( $slug ) ) {
129 156 $template = "$temp-$slug.php";
130 157
131 158 if ( ! file_exists( $template ) ) {
@@ -151,8 +178,11 @@
151 178 *
152 179 * @return string - string containing html of template
153 180 */
154 181 function qi_blocks_get_template_part( $module, $template, $slug = '', $params = array() ) {
182 + $module = qi_blocks_sanitize_module_template_part( $module );
183 + $template = qi_blocks_sanitize_module_template_part( $template );
184 +
155 185 $temp = QI_BLOCKS_INC_PATH . '/' . $module . '/' . $template;
156 186
157 187 $template = qi_blocks_get_template_with_slug( $temp, $slug );
158 188
@@ -169,8 +199,9 @@
169 199 * @param string $slug
170 200 * @param array $params array of parameters to pass to template
171 201 */
172 202 function qi_blocks_template_part( $module, $template, $slug = '', $params = array() ) {
203 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
173 204 echo qi_blocks_get_template_part( $module, $template, $slug, $params );
174 205 }
175 206 }
176 207
@@ -186,8 +217,11 @@
186 217 * @return string - string containing html of template
187 218 */
188 219 function qi_blocks_get_block_list_template_part( $module, $template, $slug = '', $params = array() ) {
189 220 $temp_in_variation = false;
221 + $module = qi_blocks_sanitize_module_template_part( $module );
222 + $template = qi_blocks_sanitize_module_template_part( $template );
223 + $slug = qi_blocks_sanitize_module_template_part( $slug );
190 224
191 225 /* In order to use this way of templating, option for list item layout must be called layoyt */
192 226 if ( isset( $params['layout'] ) ) {
193 227 /* Check if folder for variation exists */
@@ -221,8 +255,9 @@
221 255 *
222 256 * @see qi_blocks_get_class_attribute()
223 257 */
224 258 function qi_blocks_class_attribute( $value ) {
259 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
225 260 echo qi_blocks_get_class_attribute( $value );
226 261 }
227 262 }
228 263
@@ -249,8 +284,9 @@
249 284 *
250 285 * @see qi_blocks_get_id_attribute()
251 286 */
252 287 function qi_blocks_id_attribute( $value ) {
288 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
253 289 echo qi_blocks_get_id_attribute( $value );
254 290 }
255 291 }
256 292
@@ -276,8 +312,9 @@
276 312 * @param array $attrs
277 313 * @param bool $allow_zero_values
278 314 */
279 315 function qi_blocks_inline_attrs( $attrs, $allow_zero_values = false ) {
316 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
280 317 echo qi_blocks_get_inline_attrs( $attrs, $allow_zero_values );
281 318 }
282 319 }
283 320
@@ -321,8 +358,16 @@
321 358 *
322 359 * @return string generated html attribute
323 360 */
324 361 function qi_blocks_get_inline_attr( $value, $attr, $glue = '', $allow_zero_values = false ) {
362 + $properties = '';
363 +
364 + // Leave only allowed characters in attr.
365 + preg_match( '/[-_a-z0-9]+/', $attr, $attr_matches );
366 +
367 + $single_attr_key = $attr_matches[0];
368 +
369 + // Concatenate values in one variable and check for zero values.
325 370 if ( $allow_zero_values ) {
326 371 if ( '' !== $value ) {
327 372
328 373 if ( is_array( $value ) && count( $value ) ) {
@@ -329,10 +374,8 @@
329 374 $properties = implode( $glue, $value );
330 375 } else {
331 376 $properties = $value;
332 377 }
333 -
334 - return $attr . '="' . esc_attr( $properties ) . '"';
335 378 }
336 379 } else {
337 380 if ( ! empty( $value ) ) {
338 381
@@ -342,14 +385,24 @@
342 385 $properties = $value;
343 386 } else {
344 387 return '';
345 388 }
389 + }
390 + }
346 391
347 - return $attr . '="' . esc_attr( $properties ) . '"';
348 - }
392 + if ( empty( $properties ) || empty( $attr_matches[0] ) ) {
393 + return '';
349 394 }
350 395
351 - return '';
396 + // Remove not allowed js events.
397 + if ( 'on' === substr( $single_attr_key, 0, 2 ) || 'href' === $single_attr_key || 'on' === substr( $properties, 0, 2 ) || 'href' === $properties ) {
398 + return '';
399 + }
400 +
401 + $sanitized_properties = esc_attr( sanitize_text_field( html_entity_decode( $properties ) ) );
402 + $clean_properties = preg_replace( '/<[^>]*>|#x3[ce];|&lt;|&gt;/i', '', $sanitized_properties );
403 +
404 + return $attr . '="' . $clean_properties . '"';
352 405 }
353 406 }
354 407
355 408 if ( ! function_exists( 'qi_blocks_get_query_params' ) ) {
@@ -457,9 +510,9 @@
457 510
458 511 if ( ! function_exists( 'qi_blocks_get_block_option_typography_attributes' ) ) {
459 512 /**
460 513 * Function that return block option typography attributes
461 - *
514 + *
462 515 * @param string $option_name
463 516 *
464 517 * @return array
465 518 */
@@ -469,125 +522,125 @@
469 522 return array();
470 523 }
471 524
472 525 return array(
473 - esc_attr( $option_name ) . 'FontFamily' => array(
526 + esc_attr( $option_name ) . 'FontFamily' => array(
474 527 'type' => 'string',
475 528 'default' => '',
476 529 ),
477 - esc_attr( $option_name ) . 'FontSize' => array(
530 + esc_attr( $option_name ) . 'FontSize' => array(
478 531 'type' => 'number',
479 532 'default' => '',
480 533 ),
481 - esc_attr( $option_name ) . 'FontSizeUnit' => array(
534 + esc_attr( $option_name ) . 'FontSizeUnit' => array(
482 535 'type' => 'string',
483 536 'default' => 'px',
484 537 ),
485 - esc_attr( $option_name ) . 'FontSizeDecimal' => array(
538 + esc_attr( $option_name ) . 'FontSizeDecimal' => array(
486 539 'type' => 'number',
487 540 'default' => '',
488 541 ),
489 - esc_attr( $option_name ) . 'FontSizeTablet' => array(
542 + esc_attr( $option_name ) . 'FontSizeTablet' => array(
490 543 'type' => 'number',
491 544 'default' => '',
492 545 ),
493 - esc_attr( $option_name ) . 'FontSizeMobile' => array(
546 + esc_attr( $option_name ) . 'FontSizeMobile' => array(
494 547 'type' => 'number',
495 548 'default' => '',
496 549 ),
497 - esc_attr( $option_name ) . 'FontSizeUnitTablet' => array(
550 + esc_attr( $option_name ) . 'FontSizeUnitTablet' => array(
498 551 'type' => 'string',
499 552 'default' => 'px',
500 553 ),
501 - esc_attr( $option_name ) . 'FontSizeUnitMobile' => array(
554 + esc_attr( $option_name ) . 'FontSizeUnitMobile' => array(
502 555 'type' => 'string',
503 556 'default' => 'px',
504 557 ),
505 - esc_attr( $option_name ) . 'FontSizeDecimalTablet' => array(
558 + esc_attr( $option_name ) . 'FontSizeDecimalTablet' => array(
506 559 'type' => 'number',
507 560 'default' => '',
508 561 ),
509 - esc_attr( $option_name ) . 'FontSizeDecimalMobile' => array(
562 + esc_attr( $option_name ) . 'FontSizeDecimalMobile' => array(
510 563 'type' => 'number',
511 564 'default' => '',
512 565 ),
513 - esc_attr( $option_name ) . 'FontWeight' => array(
566 + esc_attr( $option_name ) . 'FontWeight' => array(
514 567 'type' => 'string',
515 568 'default' => '',
516 569 ),
517 - esc_attr( $option_name ) . 'TextTransform' => array(
570 + esc_attr( $option_name ) . 'TextTransform' => array(
518 571 'type' => 'string',
519 572 'default' => '',
520 573 ),
521 - esc_attr( $option_name ) . 'FontStyle' => array(
574 + esc_attr( $option_name ) . 'FontStyle' => array(
522 575 'type' => 'string',
523 576 'default' => '',
524 577 ),
525 - esc_attr( $option_name ) . 'TextDecoration' => array(
578 + esc_attr( $option_name ) . 'TextDecoration' => array(
526 579 'type' => 'string',
527 580 'default' => '',
528 581 ),
529 - esc_attr( $option_name ) . 'LineHeight' => array(
582 + esc_attr( $option_name ) . 'LineHeight' => array(
530 583 'type' => 'number',
531 584 'default' => '',
532 585 ),
533 - esc_attr( $option_name ) . 'LineHeightUnit' => array(
586 + esc_attr( $option_name ) . 'LineHeightUnit' => array(
534 587 'type' => 'string',
535 588 'default' => 'px',
536 589 ),
537 - esc_attr( $option_name ) . 'LineHeightDecimal' => array(
590 + esc_attr( $option_name ) . 'LineHeightDecimal' => array(
538 591 'type' => 'number',
539 592 'default' => '',
540 593 ),
541 - esc_attr( $option_name ) . 'LineHeightTablet' => array(
594 + esc_attr( $option_name ) . 'LineHeightTablet' => array(
542 595 'type' => 'number',
543 596 'default' => '',
544 597 ),
545 - esc_attr( $option_name ) . 'LineHeightMobile' => array(
598 + esc_attr( $option_name ) . 'LineHeightMobile' => array(
546 599 'type' => 'number',
547 600 'default' => '',
548 601 ),
549 - esc_attr( $option_name ) . 'LineHeightUnitTablet' => array(
602 + esc_attr( $option_name ) . 'LineHeightUnitTablet' => array(
550 603 'type' => 'string',
551 604 'default' => 'px',
552 605 ),
553 - esc_attr( $option_name ) . 'LineHeightUnitMobile' => array(
606 + esc_attr( $option_name ) . 'LineHeightUnitMobile' => array(
554 607 'type' => 'string',
555 608 'default' => 'px',
556 609 ),
557 - esc_attr( $option_name ) . 'LineHeightDecimalTablet' => array(
610 + esc_attr( $option_name ) . 'LineHeightDecimalTablet' => array(
558 611 'type' => 'number',
559 612 'default' => '',
560 613 ),
561 - esc_attr( $option_name ) . 'LineHeightDecimalMobile' => array(
614 + esc_attr( $option_name ) . 'LineHeightDecimalMobile' => array(
562 615 'type' => 'number',
563 616 'default' => '',
564 617 ),
565 - esc_attr( $option_name ) . 'LetterSpacing' => array(
618 + esc_attr( $option_name ) . 'LetterSpacing' => array(
566 619 'type' => 'number',
567 620 'default' => '',
568 621 ),
569 - esc_attr( $option_name ) . 'LetterSpacingUnit' => array(
622 + esc_attr( $option_name ) . 'LetterSpacingUnit' => array(
570 623 'type' => 'string',
571 624 'default' => 'px',
572 625 ),
573 - esc_attr( $option_name ) . 'LetterSpacingDecimal' => array(
626 + esc_attr( $option_name ) . 'LetterSpacingDecimal' => array(
574 627 'type' => 'number',
575 628 'default' => '',
576 629 ),
577 - esc_attr( $option_name ) . 'LetterSpacingTablet' => array(
630 + esc_attr( $option_name ) . 'LetterSpacingTablet' => array(
578 631 'type' => 'number',
579 632 'default' => '',
580 633 ),
581 - esc_attr( $option_name ) . 'LetterSpacingMobile' => array(
634 + esc_attr( $option_name ) . 'LetterSpacingMobile' => array(
582 635 'type' => 'number',
583 636 'default' => '',
584 637 ),
585 - esc_attr( $option_name ) . 'LetterSpacingUnitTablet' => array(
638 + esc_attr( $option_name ) . 'LetterSpacingUnitTablet' => array(
586 639 'type' => 'string',
587 640 'default' => 'px',
588 641 ),
589 - esc_attr( $option_name ) . 'LetterSpacingUnitMobile' => array(
642 + esc_attr( $option_name ) . 'LetterSpacingUnitMobile' => array(
590 643 'type' => 'string',
591 644 'default' => 'px',
592 645 ),
593 646 esc_attr( $option_name ) . 'LetterSpacingDecimalTablet' => array(
@@ -609,798 +662,798 @@
609 662 * @return array
610 663 */
611 664 function qi_blocks_get_block_container_attributes() {
612 665 return array(
613 - 'marginTop' => array(
614 - 'type' => 'number',
666 + 'marginTop' => array(
667 + 'type' => 'number',
615 668 'default' => '',
616 669 ),
617 - 'marginTopTablet' => array(
618 - 'type' => 'number',
670 + 'marginTopTablet' => array(
671 + 'type' => 'number',
619 672 'default' => '',
620 673 ),
621 - 'marginTopMobile' => array(
622 - 'type' => 'number',
674 + 'marginTopMobile' => array(
675 + 'type' => 'number',
623 676 'default' => '',
624 677 ),
625 - 'marginTopDecimal' => array(
626 - 'type' => 'number',
678 + 'marginTopDecimal' => array(
679 + 'type' => 'number',
627 680 'default' => '',
628 681 ),
629 - 'marginTopDecimalTablet' => array(
630 - 'type' => 'number',
682 + 'marginTopDecimalTablet' => array(
683 + 'type' => 'number',
631 684 'default' => '',
632 685 ),
633 - 'marginTopDecimalMobile' => array(
634 - 'type' => 'number',
686 + 'marginTopDecimalMobile' => array(
687 + 'type' => 'number',
635 688 'default' => '',
636 689 ),
637 - 'marginRight' => array(
638 - 'type' => 'number',
690 + 'marginRight' => array(
691 + 'type' => 'number',
639 692 'default' => '',
640 693 ),
641 - 'marginRightTablet' => array(
642 - 'type' => 'number',
694 + 'marginRightTablet' => array(
695 + 'type' => 'number',
643 696 'default' => '',
644 697 ),
645 - 'marginRightMobile' => array(
646 - 'type' => 'number',
698 + 'marginRightMobile' => array(
699 + 'type' => 'number',
647 700 'default' => '',
648 701 ),
649 - 'marginRightDecimal' => array(
650 - 'type' => 'number',
702 + 'marginRightDecimal' => array(
703 + 'type' => 'number',
651 704 'default' => '',
652 705 ),
653 - 'marginRightDecimalTablet' => array(
654 - 'type' => 'number',
706 + 'marginRightDecimalTablet' => array(
707 + 'type' => 'number',
655 708 'default' => '',
656 709 ),
657 - 'marginRightDecimalMobile' => array(
658 - 'type' => 'number',
710 + 'marginRightDecimalMobile' => array(
711 + 'type' => 'number',
659 712 'default' => '',
660 713 ),
661 - 'marginBottom' => array(
662 - 'type' => 'number',
714 + 'marginBottom' => array(
715 + 'type' => 'number',
663 716 'default' => '',
664 717 ),
665 - 'marginBottomTablet' => array(
666 - 'type' => 'number',
718 + 'marginBottomTablet' => array(
719 + 'type' => 'number',
667 720 'default' => '',
668 721 ),
669 - 'marginBottomMobile' => array(
670 - 'type' => 'number',
722 + 'marginBottomMobile' => array(
723 + 'type' => 'number',
671 724 'default' => '',
672 725 ),
673 - 'marginBottomDecimal' => array(
674 - 'type' => 'number',
726 + 'marginBottomDecimal' => array(
727 + 'type' => 'number',
675 728 'default' => '',
676 729 ),
677 - 'marginBottomDecimalTablet' => array(
678 - 'type' => 'number',
730 + 'marginBottomDecimalTablet' => array(
731 + 'type' => 'number',
679 732 'default' => '',
680 733 ),
681 - 'marginBottomDecimalMobile' => array(
682 - 'type' => 'number',
734 + 'marginBottomDecimalMobile' => array(
735 + 'type' => 'number',
683 736 'default' => '',
684 737 ),
685 - 'marginLeft' => array(
686 - 'type' => 'number',
738 + 'marginLeft' => array(
739 + 'type' => 'number',
687 740 'default' => '',
688 741 ),
689 - 'marginLeftTablet' => array(
690 - 'type' => 'number',
742 + 'marginLeftTablet' => array(
743 + 'type' => 'number',
691 744 'default' => '',
692 745 ),
693 - 'marginLeftMobile' => array(
694 - 'type' => 'number',
746 + 'marginLeftMobile' => array(
747 + 'type' => 'number',
695 748 'default' => '',
696 749 ),
697 - 'marginLeftDecimal' => array(
698 - 'type' => 'number',
750 + 'marginLeftDecimal' => array(
751 + 'type' => 'number',
699 752 'default' => '',
700 753 ),
701 - 'marginLeftDecimalTablet' => array(
702 - 'type' => 'number',
754 + 'marginLeftDecimalTablet' => array(
755 + 'type' => 'number',
703 756 'default' => '',
704 757 ),
705 - 'marginLeftDecimalMobile' => array(
706 - 'type' => 'number',
758 + 'marginLeftDecimalMobile' => array(
759 + 'type' => 'number',
707 760 'default' => '',
708 761 ),
709 - 'marginUnit' => array(
710 - 'type' => 'string',
762 + 'marginUnit' => array(
763 + 'type' => 'string',
711 764 'default' => 'px',
712 765 ),
713 - 'marginUnitTablet' => array(
714 - 'type' => 'string',
766 + 'marginUnitTablet' => array(
767 + 'type' => 'string',
715 768 'default' => 'px',
716 769 ),
717 - 'marginUnitMobile' => array(
718 - 'type' => 'string',
770 + 'marginUnitMobile' => array(
771 + 'type' => 'string',
719 772 'default' => 'px',
720 773 ),
721 - 'paddingTop' => array(
722 - 'type' => 'number',
774 + 'paddingTop' => array(
775 + 'type' => 'number',
723 776 'default' => '',
724 777 ),
725 - 'paddingTopTablet' => array(
726 - 'type' => 'number',
778 + 'paddingTopTablet' => array(
779 + 'type' => 'number',
727 780 'default' => '',
728 781 ),
729 - 'paddingTopMobile' => array(
730 - 'type' => 'number',
782 + 'paddingTopMobile' => array(
783 + 'type' => 'number',
731 784 'default' => '',
732 785 ),
733 - 'paddingTopDecimal' => array(
734 - 'type' => 'number',
786 + 'paddingTopDecimal' => array(
787 + 'type' => 'number',
735 788 'default' => '',
736 789 ),
737 - 'paddingTopDecimalTablet' => array(
738 - 'type' => 'number',
790 + 'paddingTopDecimalTablet' => array(
791 + 'type' => 'number',
739 792 'default' => '',
740 793 ),
741 - 'paddingTopDecimalMobile' => array(
742 - 'type' => 'number',
794 + 'paddingTopDecimalMobile' => array(
795 + 'type' => 'number',
743 796 'default' => '',
744 797 ),
745 - 'paddingRight' => array(
746 - 'type' => 'number',
798 + 'paddingRight' => array(
799 + 'type' => 'number',
747 800 'default' => '',
748 801 ),
749 - 'paddingRightTablet' => array(
750 - 'type' => 'number',
802 + 'paddingRightTablet' => array(
803 + 'type' => 'number',
751 804 'default' => '',
752 805 ),
753 - 'paddingRightMobile' => array(
754 - 'type' => 'number',
806 + 'paddingRightMobile' => array(
807 + 'type' => 'number',
755 808 'default' => '',
756 809 ),
757 - 'paddingRightDecimal' => array(
758 - 'type' => 'number',
810 + 'paddingRightDecimal' => array(
811 + 'type' => 'number',
759 812 'default' => '',
760 813 ),
761 - 'paddingRightDecimalTablet' => array(
762 - 'type' => 'number',
814 + 'paddingRightDecimalTablet' => array(
815 + 'type' => 'number',
763 816 'default' => '',
764 817 ),
765 - 'paddingRightDecimalMobile' => array(
766 - 'type' => 'number',
818 + 'paddingRightDecimalMobile' => array(
819 + 'type' => 'number',
767 820 'default' => '',
768 821 ),
769 - 'paddingBottom' => array(
770 - 'type' => 'number',
822 + 'paddingBottom' => array(
823 + 'type' => 'number',
771 824 'default' => '',
772 825 ),
773 - 'paddingBottomTablet' => array(
774 - 'type' => 'number',
826 + 'paddingBottomTablet' => array(
827 + 'type' => 'number',
775 828 'default' => '',
776 829 ),
777 - 'paddingBottomMobile' => array(
778 - 'type' => 'number',
830 + 'paddingBottomMobile' => array(
831 + 'type' => 'number',
779 832 'default' => '',
780 833 ),
781 - 'paddingBottomDecimal' => array(
782 - 'type' => 'number',
834 + 'paddingBottomDecimal' => array(
835 + 'type' => 'number',
783 836 'default' => '',
784 837 ),
785 - 'paddingBottomDecimalTablet' => array(
786 - 'type' => 'number',
838 + 'paddingBottomDecimalTablet' => array(
839 + 'type' => 'number',
787 840 'default' => '',
788 841 ),
789 - 'paddingBottomDecimalMobile' => array(
790 - 'type' => 'number',
842 + 'paddingBottomDecimalMobile' => array(
843 + 'type' => 'number',
791 844 'default' => '',
792 845 ),
793 - 'paddingLeft' => array(
794 - 'type' => 'number',
846 + 'paddingLeft' => array(
847 + 'type' => 'number',
795 848 'default' => '',
796 849 ),
797 - 'paddingLeftTablet' => array(
798 - 'type' => 'number',
850 + 'paddingLeftTablet' => array(
851 + 'type' => 'number',
799 852 'default' => '',
800 853 ),
801 - 'paddingLeftMobile' => array(
802 - 'type' => 'number',
854 + 'paddingLeftMobile' => array(
855 + 'type' => 'number',
803 856 'default' => '',
804 857 ),
805 - 'paddingLeftDecimal' => array(
806 - 'type' => 'number',
858 + 'paddingLeftDecimal' => array(
859 + 'type' => 'number',
807 860 'default' => '',
808 861 ),
809 - 'paddingLeftDecimalTablet' => array(
810 - 'type' => 'number',
862 + 'paddingLeftDecimalTablet' => array(
863 + 'type' => 'number',
811 864 'default' => '',
812 865 ),
813 - 'paddingLeftDecimalMobile' => array(
814 - 'type' => 'number',
866 + 'paddingLeftDecimalMobile' => array(
867 + 'type' => 'number',
815 868 'default' => '',
816 869 ),
817 - 'paddingUnit' => array(
818 - 'type' => 'string',
870 + 'paddingUnit' => array(
871 + 'type' => 'string',
819 872 'default' => 'px',
820 873 ),
821 - 'paddingUnitTablet' => array(
822 - 'type' => 'string',
874 + 'paddingUnitTablet' => array(
875 + 'type' => 'string',
823 876 'default' => 'px',
824 877 ),
825 - 'paddingUnitMobile' => array(
826 - 'type' => 'string',
878 + 'paddingUnitMobile' => array(
879 + 'type' => 'string',
827 880 'default' => 'px',
828 881 ),
829 - 'zIndex' => array(
830 - 'type' => 'number',
882 + 'zIndex' => array(
883 + 'type' => 'number',
831 884 'default' => '',
832 885 ),
833 - 'cssId' => array(
834 - 'type' => 'string',
886 + 'cssId' => array(
887 + 'type' => 'string',
835 888 'default' => '',
836 889 ),
837 - 'cssClasses' => array(
838 - 'type' => 'string',
890 + 'cssClasses' => array(
891 + 'type' => 'string',
839 892 'default' => '',
840 893 ),
841 - 'entranceAnimation' => array(
842 - 'type' => 'string',
894 + 'entranceAnimation' => array(
895 + 'type' => 'string',
843 896 'default' => '',
844 897 ),
845 - 'entranceAnimationDuration' => array(
846 - 'type' => 'string',
898 + 'entranceAnimationDuration' => array(
899 + 'type' => 'string',
847 900 'default' => 'normal',
848 901 ),
849 - 'entranceAnimationDelay' => array(
850 - 'type' => 'number',
902 + 'entranceAnimationDelay' => array(
903 + 'type' => 'number',
851 904 'default' => '',
852 905 ),
853 - 'advancedBackgroundType' => array(
854 - 'type' => 'string',
906 + 'advancedBackgroundType' => array(
907 + 'type' => 'string',
855 908 'default' => '',
856 909 ),
857 - 'advancedBackgroundColor' => array(
858 - 'type' => 'string',
910 + 'advancedBackgroundColor' => array(
911 + 'type' => 'string',
859 912 'default' => '',
860 913 ),
861 - 'advancedBackgroundImage' => array(
862 - 'type' => 'object',
914 + 'advancedBackgroundImage' => array(
915 + 'type' => 'object',
863 916 'default' => array(
864 - 'id' => NULL,
917 + 'id' => null,
865 918 'url' => '',
866 919 'alt' => '',
867 920 ),
868 921 ),
869 - 'advancedBackgroundImageTablet' => array(
870 - 'type' => 'object',
922 + 'advancedBackgroundImageTablet' => array(
923 + 'type' => 'object',
871 924 'default' => array(
872 - 'id' => NULL,
925 + 'id' => null,
873 926 'url' => '',
874 927 'alt' => '',
875 928 ),
876 929 ),
877 - 'advancedBackgroundImageMobile' => array(
878 - 'type' => 'object',
930 + 'advancedBackgroundImageMobile' => array(
931 + 'type' => 'object',
879 932 'default' => array(
880 - 'id' => NULL,
933 + 'id' => null,
881 934 'url' => '',
882 935 'alt' => '',
883 936 ),
884 937 ),
885 - 'advancedBackgroundPosition' => array(
886 - 'type' => 'string',
938 + 'advancedBackgroundPosition' => array(
939 + 'type' => 'string',
887 940 'default' => '',
888 941 ),
889 - 'advancedBackgroundPositionTablet' => array(
890 - 'type' => 'string',
942 + 'advancedBackgroundPositionTablet' => array(
943 + 'type' => 'string',
891 944 'default' => '',
892 945 ),
893 - 'advancedBackgroundPositionMobile' => array(
894 - 'type' => 'string',
946 + 'advancedBackgroundPositionMobile' => array(
947 + 'type' => 'string',
895 948 'default' => '',
896 949 ),
897 - 'advancedBackgroundXPosition' => array(
898 - 'type' => 'number',
950 + 'advancedBackgroundXPosition' => array(
951 + 'type' => 'number',
899 952 'default' => '',
900 953 ),
901 - 'advancedBackgroundXPositionUnit' => array(
902 - 'type' => 'string',
954 + 'advancedBackgroundXPositionUnit' => array(
955 + 'type' => 'string',
903 956 'default' => 'px',
904 957 ),
905 - 'advancedBackgroundXPositionDecimal' => array(
906 - 'type' => 'number',
958 + 'advancedBackgroundXPositionDecimal' => array(
959 + 'type' => 'number',
907 960 'default' => '',
908 961 ),
909 - 'advancedBackgroundXPositionTablet' => array(
910 - 'type' => 'number',
962 + 'advancedBackgroundXPositionTablet' => array(
963 + 'type' => 'number',
911 964 'default' => '',
912 965 ),
913 - 'advancedBackgroundXPositionMobile' => array(
914 - 'type' => 'number',
966 + 'advancedBackgroundXPositionMobile' => array(
967 + 'type' => 'number',
915 968 'default' => '',
916 969 ),
917 - 'advancedBackgroundXPositionUnitTablet' => array(
918 - 'type' => 'string',
970 + 'advancedBackgroundXPositionUnitTablet' => array(
971 + 'type' => 'string',
919 972 'default' => 'px',
920 973 ),
921 - 'advancedBackgroundXPositionUnitMobile' => array(
922 - 'type' => 'string',
974 + 'advancedBackgroundXPositionUnitMobile' => array(
975 + 'type' => 'string',
923 976 'default' => 'px',
924 977 ),
925 978 'advancedBackgroundXPositionDecimalTablet' => array(
926 - 'type' => 'number',
979 + 'type' => 'number',
927 980 'default' => '',
928 981 ),
929 982 'advancedBackgroundXPositionDecimalMobile' => array(
930 - 'type' => 'number',
983 + 'type' => 'number',
931 984 'default' => '',
932 985 ),
933 - 'advancedBackgroundYPosition' => array(
934 - 'type' => 'number',
986 + 'advancedBackgroundYPosition' => array(
987 + 'type' => 'number',
935 988 'default' => '',
936 989 ),
937 - 'advancedBackgroundYPositionUnit' => array(
938 - 'type' => 'string',
990 + 'advancedBackgroundYPositionUnit' => array(
991 + 'type' => 'string',
939 992 'default' => 'px',
940 993 ),
941 - 'advancedBackgroundYPositionDecimal' => array(
942 - 'type' => 'number',
994 + 'advancedBackgroundYPositionDecimal' => array(
995 + 'type' => 'number',
943 996 'default' => '',
944 997 ),
945 - 'advancedBackgroundYPositionTablet' => array(
946 - 'type' => 'number',
998 + 'advancedBackgroundYPositionTablet' => array(
999 + 'type' => 'number',
947 1000 'default' => '',
948 1001 ),
949 - 'advancedBackgroundYPositionMobile' => array(
950 - 'type' => 'number',
1002 + 'advancedBackgroundYPositionMobile' => array(
1003 + 'type' => 'number',
951 1004 'default' => '',
952 1005 ),
953 - 'advancedBackgroundYPositionUnitTablet' => array(
954 - 'type' => 'string',
1006 + 'advancedBackgroundYPositionUnitTablet' => array(
1007 + 'type' => 'string',
955 1008 'default' => 'px',
956 1009 ),
957 - 'advancedBackgroundYPositionUnitMobile' => array(
958 - 'type' => 'string',
1010 + 'advancedBackgroundYPositionUnitMobile' => array(
1011 + 'type' => 'string',
959 1012 'default' => 'px',
960 1013 ),
961 1014 'advancedBackgroundYPositionDecimalTablet' => array(
962 - 'type' => 'number',
1015 + 'type' => 'number',
963 1016 'default' => '',
964 1017 ),
965 1018 'advancedBackgroundYPositionDecimalMobile' => array(
966 - 'type' => 'number',
1019 + 'type' => 'number',
967 1020 'default' => '',
968 1021 ),
969 - 'advancedBackgroundAttachment' => array(
970 - 'type' => 'string',
1022 + 'advancedBackgroundAttachment' => array(
1023 + 'type' => 'string',
971 1024 'default' => '',
972 1025 ),
973 - 'advancedBackgroundRepeat' => array(
974 - 'type' => 'string',
1026 + 'advancedBackgroundRepeat' => array(
1027 + 'type' => 'string',
975 1028 'default' => '',
976 1029 ),
977 - 'advancedBackgroundRepeatTablet' => array(
978 - 'type' => 'string',
1030 + 'advancedBackgroundRepeatTablet' => array(
1031 + 'type' => 'string',
979 1032 'default' => '',
980 1033 ),
981 - 'advancedBackgroundRepeatMobile' => array(
982 - 'type' => 'string',
1034 + 'advancedBackgroundRepeatMobile' => array(
1035 + 'type' => 'string',
983 1036 'default' => '',
984 1037 ),
985 - 'advancedBackgroundSize' => array(
986 - 'type' => 'string',
1038 + 'advancedBackgroundSize' => array(
1039 + 'type' => 'string',
987 1040 'default' => '',
988 1041 ),
989 - 'advancedBackgroundSizeTablet' => array(
990 - 'type' => 'string',
1042 + 'advancedBackgroundSizeTablet' => array(
1043 + 'type' => 'string',
991 1044 'default' => '',
992 1045 ),
993 - 'advancedBackgroundSizeMobile' => array(
994 - 'type' => 'string',
1046 + 'advancedBackgroundSizeMobile' => array(
1047 + 'type' => 'string',
995 1048 'default' => '',
996 1049 ),
997 - 'advancedBackgroundSizeWidth' => array(
998 - 'type' => 'number',
1050 + 'advancedBackgroundSizeWidth' => array(
1051 + 'type' => 'number',
999 1052 'default' => '',
1000 1053 ),
1001 - 'advancedBackgroundSizeWidthUnit' => array(
1002 - 'type' => 'string',
1054 + 'advancedBackgroundSizeWidthUnit' => array(
1055 + 'type' => 'string',
1003 1056 'default' => 'px',
1004 1057 ),
1005 - 'advancedBackgroundSizeWidthDecimal' => array(
1006 - 'type' => 'number',
1058 + 'advancedBackgroundSizeWidthDecimal' => array(
1059 + 'type' => 'number',
1007 1060 'default' => '',
1008 1061 ),
1009 - 'advancedBackgroundSizeWidthTablet' => array(
1010 - 'type' => 'number',
1062 + 'advancedBackgroundSizeWidthTablet' => array(
1063 + 'type' => 'number',
1011 1064 'default' => '',
1012 1065 ),
1013 - 'advancedBackgroundSizeWidthMobile' => array(
1014 - 'type' => 'number',
1066 + 'advancedBackgroundSizeWidthMobile' => array(
1067 + 'type' => 'number',
1015 1068 'default' => '',
1016 1069 ),
1017 - 'advancedBackgroundSizeWidthUnitTablet' => array(
1018 - 'type' => 'string',
1070 + 'advancedBackgroundSizeWidthUnitTablet' => array(
1071 + 'type' => 'string',
1019 1072 'default' => 'px',
1020 1073 ),
1021 - 'advancedBackgroundSizeWidthUnitMobile' => array(
1022 - 'type' => 'string',
1074 + 'advancedBackgroundSizeWidthUnitMobile' => array(
1075 + 'type' => 'string',
1023 1076 'default' => 'px',
1024 1077 ),
1025 1078 'advancedBackgroundSizeWidthDecimalTablet' => array(
1026 - 'type' => 'number',
1079 + 'type' => 'number',
1027 1080 'default' => '',
1028 1081 ),
1029 1082 'advancedBackgroundSizeWidthDecimalMobile' => array(
1030 - 'type' => 'number',
1083 + 'type' => 'number',
1031 1084 'default' => '',
1032 1085 ),
1033 - 'advancedBackgroundGradientColor1' => array(
1034 - 'type' => 'string',
1086 + 'advancedBackgroundGradientColor1' => array(
1087 + 'type' => 'string',
1035 1088 'default' => '',
1036 1089 ),
1037 - 'advancedBackgroundGradientLocation1' => array(
1038 - 'type' => 'number',
1090 + 'advancedBackgroundGradientLocation1' => array(
1091 + 'type' => 'number',
1039 1092 'default' => '',
1040 1093 ),
1041 - 'advancedBackgroundGradientColor2' => array(
1042 - 'type' => 'string',
1094 + 'advancedBackgroundGradientColor2' => array(
1095 + 'type' => 'string',
1043 1096 'default' => '',
1044 1097 ),
1045 - 'advancedBackgroundGradientLocation2' => array(
1046 - 'type' => 'number',
1098 + 'advancedBackgroundGradientLocation2' => array(
1099 + 'type' => 'number',
1047 1100 'default' => '',
1048 1101 ),
1049 - 'advancedBackgroundGradientType' => array(
1050 - 'type' => 'string',
1102 + 'advancedBackgroundGradientType' => array(
1103 + 'type' => 'string',
1051 1104 'default' => 'linear',
1052 1105 ),
1053 - 'advancedBackgroundGradientTypeAngle' => array(
1054 - 'type' => 'number',
1106 + 'advancedBackgroundGradientTypeAngle' => array(
1107 + 'type' => 'number',
1055 1108 'default' => '',
1056 1109 ),
1057 - 'advancedBackgroundGradientTypePosition' => array(
1058 - 'type' => 'string',
1110 + 'advancedBackgroundGradientTypePosition' => array(
1111 + 'type' => 'string',
1059 1112 'default' => 'center center',
1060 1113 ),
1061 - 'advancedBorderStyle' => array(
1062 - 'type' => 'string',
1114 + 'advancedBorderStyle' => array(
1115 + 'type' => 'string',
1063 1116 'default' => '',
1064 1117 ),
1065 - 'advancedBorderColor' => array(
1066 - 'type' => 'string',
1118 + 'advancedBorderColor' => array(
1119 + 'type' => 'string',
1067 1120 'default' => '',
1068 1121 ),
1069 - 'advancedBorderWidthTop' => array(
1070 - 'type' => 'number',
1122 + 'advancedBorderWidthTop' => array(
1123 + 'type' => 'number',
1071 1124 'default' => '',
1072 1125 ),
1073 - 'advancedBorderWidthTopTablet' => array(
1074 - 'type' => 'number',
1126 + 'advancedBorderWidthTopTablet' => array(
1127 + 'type' => 'number',
1075 1128 'default' => '',
1076 1129 ),
1077 - 'advancedBorderWidthTopMobile' => array(
1078 - 'type' => 'number',
1130 + 'advancedBorderWidthTopMobile' => array(
1131 + 'type' => 'number',
1079 1132 'default' => '',
1080 1133 ),
1081 - 'advancedBorderWidthRight' => array(
1082 - 'type' => 'number',
1134 + 'advancedBorderWidthRight' => array(
1135 + 'type' => 'number',
1083 1136 'default' => '',
1084 1137 ),
1085 - 'advancedBorderWidthRightTablet' => array(
1086 - 'type' => 'number',
1138 + 'advancedBorderWidthRightTablet' => array(
1139 + 'type' => 'number',
1087 1140 'default' => '',
1088 1141 ),
1089 - 'advancedBorderWidthRightMobile' => array(
1090 - 'type' => 'number',
1142 + 'advancedBorderWidthRightMobile' => array(
1143 + 'type' => 'number',
1091 1144 'default' => '',
1092 1145 ),
1093 - 'advancedBorderWidthBottom' => array(
1094 - 'type' => 'number',
1146 + 'advancedBorderWidthBottom' => array(
1147 + 'type' => 'number',
1095 1148 'default' => '',
1096 1149 ),
1097 - 'advancedBorderWidthBottomTablet' => array(
1098 - 'type' => 'number',
1150 + 'advancedBorderWidthBottomTablet' => array(
1151 + 'type' => 'number',
1099 1152 'default' => '',
1100 1153 ),
1101 - 'advancedBorderWidthBottomMobile' => array(
1102 - 'type' => 'number',
1154 + 'advancedBorderWidthBottomMobile' => array(
1155 + 'type' => 'number',
1103 1156 'default' => '',
1104 1157 ),
1105 - 'advancedBorderWidthLeft' => array(
1106 - 'type' => 'number',
1158 + 'advancedBorderWidthLeft' => array(
1159 + 'type' => 'number',
1107 1160 'default' => '',
1108 1161 ),
1109 - 'advancedBorderWidthLeftTablet' => array(
1110 - 'type' => 'number',
1162 + 'advancedBorderWidthLeftTablet' => array(
1163 + 'type' => 'number',
1111 1164 'default' => '',
1112 1165 ),
1113 - 'advancedBorderWidthLeftMobile' => array(
1114 - 'type' => 'number',
1166 + 'advancedBorderWidthLeftMobile' => array(
1167 + 'type' => 'number',
1115 1168 'default' => '',
1116 1169 ),
1117 - 'advancedBorderWidthUnit' => array(
1118 - 'type' => 'string',
1170 + 'advancedBorderWidthUnit' => array(
1171 + 'type' => 'string',
1119 1172 'default' => 'px',
1120 1173 ),
1121 - 'advancedBorderWidthUnitTablet' => array(
1122 - 'type' => 'string',
1174 + 'advancedBorderWidthUnitTablet' => array(
1175 + 'type' => 'string',
1123 1176 'default' => 'px',
1124 1177 ),
1125 - 'advancedBorderWidthUnitMobile' => array(
1126 - 'type' => 'string',
1178 + 'advancedBorderWidthUnitMobile' => array(
1179 + 'type' => 'string',
1127 1180 'default' => 'px',
1128 1181 ),
1129 - 'advancedBorderRadiusTop' => array(
1130 - 'type' => 'number',
1182 + 'advancedBorderRadiusTop' => array(
1183 + 'type' => 'number',
1131 1184 'default' => '',
1132 1185 ),
1133 - 'advancedBorderRadiusTopTablet' => array(
1134 - 'type' => 'number',
1186 + 'advancedBorderRadiusTopTablet' => array(
1187 + 'type' => 'number',
1135 1188 'default' => '',
1136 1189 ),
1137 - 'advancedBorderRadiusTopMobile' => array(
1138 - 'type' => 'number',
1190 + 'advancedBorderRadiusTopMobile' => array(
1191 + 'type' => 'number',
1139 1192 'default' => '',
1140 1193 ),
1141 - 'advancedBorderRadiusTopDecimal' => array(
1142 - 'type' => 'number',
1194 + 'advancedBorderRadiusTopDecimal' => array(
1195 + 'type' => 'number',
1143 1196 'default' => '',
1144 1197 ),
1145 - 'advancedBorderRadiusTopDecimalTablet' => array(
1146 - 'type' => 'number',
1198 + 'advancedBorderRadiusTopDecimalTablet' => array(
1199 + 'type' => 'number',
1147 1200 'default' => '',
1148 1201 ),
1149 - 'advancedBorderRadiusTopDecimalMobile' => array(
1150 - 'type' => 'number',
1202 + 'advancedBorderRadiusTopDecimalMobile' => array(
1203 + 'type' => 'number',
1151 1204 'default' => '',
1152 1205 ),
1153 - 'advancedBorderRadiusRight' => array(
1154 - 'type' => 'number',
1206 + 'advancedBorderRadiusRight' => array(
1207 + 'type' => 'number',
1155 1208 'default' => '',
1156 1209 ),
1157 - 'advancedBorderRadiusRightTablet' => array(
1158 - 'type' => 'number',
1210 + 'advancedBorderRadiusRightTablet' => array(
1211 + 'type' => 'number',
1159 1212 'default' => '',
1160 1213 ),
1161 - 'advancedBorderRadiusRightMobile' => array(
1162 - 'type' => 'number',
1214 + 'advancedBorderRadiusRightMobile' => array(
1215 + 'type' => 'number',
1163 1216 'default' => '',
1164 1217 ),
1165 - 'advancedBorderRadiusRightDecimal' => array(
1166 - 'type' => 'number',
1218 + 'advancedBorderRadiusRightDecimal' => array(
1219 + 'type' => 'number',
1167 1220 'default' => '',
1168 1221 ),
1169 - 'advancedBorderRadiusRightDecimalTablet' => array(
1170 - 'type' => 'number',
1222 + 'advancedBorderRadiusRightDecimalTablet' => array(
1223 + 'type' => 'number',
1171 1224 'default' => '',
1172 1225 ),
1173 - 'advancedBorderRadiusRightDecimalMobile' => array(
1174 - 'type' => 'number',
1226 + 'advancedBorderRadiusRightDecimalMobile' => array(
1227 + 'type' => 'number',
1175 1228 'default' => '',
1176 1229 ),
1177 - 'advancedBorderRadiusBottom' => array(
1178 - 'type' => 'number',
1230 + 'advancedBorderRadiusBottom' => array(
1231 + 'type' => 'number',
1179 1232 'default' => '',
1180 1233 ),
1181 - 'advancedBorderRadiusBottomTablet' => array(
1182 - 'type' => 'number',
1234 + 'advancedBorderRadiusBottomTablet' => array(
1235 + 'type' => 'number',
1183 1236 'default' => '',
1184 1237 ),
1185 - 'advancedBorderRadiusBottomMobile' => array(
1186 - 'type' => 'number',
1238 + 'advancedBorderRadiusBottomMobile' => array(
1239 + 'type' => 'number',
1187 1240 'default' => '',
1188 1241 ),
1189 - 'advancedBorderRadiusBottomDecimal' => array(
1190 - 'type' => 'number',
1242 + 'advancedBorderRadiusBottomDecimal' => array(
1243 + 'type' => 'number',
1191 1244 'default' => '',
1192 1245 ),
1193 - 'advancedBorderRadiusBottomDecimalTablet' => array(
1194 - 'type' => 'number',
1246 + 'advancedBorderRadiusBottomDecimalTablet' => array(
1247 + 'type' => 'number',
1195 1248 'default' => '',
1196 1249 ),
1197 - 'advancedBorderRadiusBottomDecimalMobile' => array(
1198 - 'type' => 'number',
1250 + 'advancedBorderRadiusBottomDecimalMobile' => array(
1251 + 'type' => 'number',
1199 1252 'default' => '',
1200 1253 ),
1201 - 'advancedBorderRadiusLeft' => array(
1202 - 'type' => 'number',
1254 + 'advancedBorderRadiusLeft' => array(
1255 + 'type' => 'number',
1203 1256 'default' => '',
1204 1257 ),
1205 - 'advancedBorderRadiusLeftTablet' => array(
1206 - 'type' => 'number',
1258 + 'advancedBorderRadiusLeftTablet' => array(
1259 + 'type' => 'number',
1207 1260 'default' => '',
1208 1261 ),
1209 - 'advancedBorderRadiusLeftMobile' => array(
1210 - 'type' => 'number',
1262 + 'advancedBorderRadiusLeftMobile' => array(
1263 + 'type' => 'number',
1211 1264 'default' => '',
1212 1265 ),
1213 - 'advancedBorderRadiusLeftDecimal' => array(
1214 - 'type' => 'number',
1266 + 'advancedBorderRadiusLeftDecimal' => array(
1267 + 'type' => 'number',
1215 1268 'default' => '',
1216 1269 ),
1217 - 'advancedBorderRadiusLeftDecimalTablet' => array(
1218 - 'type' => 'number',
1270 + 'advancedBorderRadiusLeftDecimalTablet' => array(
1271 + 'type' => 'number',
1219 1272 'default' => '',
1220 1273 ),
1221 - 'advancedBorderRadiusLeftDecimalMobile' => array(
1222 - 'type' => 'number',
1274 + 'advancedBorderRadiusLeftDecimalMobile' => array(
1275 + 'type' => 'number',
1223 1276 'default' => '',
1224 1277 ),
1225 - 'advancedBorderRadiusUnit' => array(
1226 - 'type' => 'string',
1278 + 'advancedBorderRadiusUnit' => array(
1279 + 'type' => 'string',
1227 1280 'default' => 'px',
1228 1281 ),
1229 - 'advancedBorderRadiusUnitTablet' => array(
1230 - 'type' => 'string',
1282 + 'advancedBorderRadiusUnitTablet' => array(
1283 + 'type' => 'string',
1231 1284 'default' => 'px',
1232 1285 ),
1233 - 'advancedBorderRadiusUnitMobile' => array(
1234 - 'type' => 'string',
1286 + 'advancedBorderRadiusUnitMobile' => array(
1287 + 'type' => 'string',
1235 1288 'default' => 'px',
1236 1289 ),
1237 - 'advancedBoxShadowColor' => array(
1238 - 'type' => 'string',
1290 + 'advancedBoxShadowColor' => array(
1291 + 'type' => 'string',
1239 1292 'default' => '',
1240 1293 ),
1241 - 'advancedBoxShadowHorizontal' => array(
1242 - 'type' => 'number',
1294 + 'advancedBoxShadowHorizontal' => array(
1295 + 'type' => 'number',
1243 1296 'default' => '',
1244 1297 ),
1245 - 'advancedBoxShadowVertical' => array(
1246 - 'type' => 'number',
1298 + 'advancedBoxShadowVertical' => array(
1299 + 'type' => 'number',
1247 1300 'default' => '',
1248 1301 ),
1249 - 'advancedBoxShadowBlur' => array(
1250 - 'type' => 'number',
1302 + 'advancedBoxShadowBlur' => array(
1303 + 'type' => 'number',
1251 1304 'default' => '',
1252 1305 ),
1253 - 'advancedBoxShadowSpread' => array(
1254 - 'type' => 'number',
1306 + 'advancedBoxShadowSpread' => array(
1307 + 'type' => 'number',
1255 1308 'default' => '',
1256 1309 ),
1257 - 'advancedBoxShadowPosition' => array(
1258 - 'type' => 'string',
1310 + 'advancedBoxShadowPosition' => array(
1311 + 'type' => 'string',
1259 1312 'default' => '',
1260 1313 ),
1261 - 'blockWidth' => array(
1262 - 'type' => 'string',
1314 + 'blockWidth' => array(
1315 + 'type' => 'string',
1263 1316 'default' => '',
1264 1317 ),
1265 - 'blockWidthTablet' => array(
1266 - 'type' => 'string',
1318 + 'blockWidthTablet' => array(
1319 + 'type' => 'string',
1267 1320 'default' => '',
1268 1321 ),
1269 - 'blockWidthMobile' => array(
1270 - 'type' => 'string',
1322 + 'blockWidthMobile' => array(
1323 + 'type' => 'string',
1271 1324 'default' => '',
1272 1325 ),
1273 - 'blockCustomWidth' => array(
1274 - 'type' => 'number',
1326 + 'blockCustomWidth' => array(
1327 + 'type' => 'number',
1275 1328 'default' => '',
1276 1329 ),
1277 - 'blockCustomWidthUnit' => array(
1278 - 'type' => 'string',
1330 + 'blockCustomWidthUnit' => array(
1331 + 'type' => 'string',
1279 1332 'default' => 'px',
1280 1333 ),
1281 - 'blockCustomWidthDecimal' => array(
1282 - 'type' => 'number',
1334 + 'blockCustomWidthDecimal' => array(
1335 + 'type' => 'number',
1283 1336 'default' => '',
1284 1337 ),
1285 - 'blockCustomWidthTablet' => array(
1286 - 'type' => 'number',
1338 + 'blockCustomWidthTablet' => array(
1339 + 'type' => 'number',
1287 1340 'default' => '',
1288 1341 ),
1289 - 'blockCustomWidthMobile' => array(
1290 - 'type' => 'number',
1342 + 'blockCustomWidthMobile' => array(
1343 + 'type' => 'number',
1291 1344 'default' => '',
1292 1345 ),
1293 - 'blockCustomWidthUnitTablet' => array(
1294 - 'type' => 'string',
1346 + 'blockCustomWidthUnitTablet' => array(
1347 + 'type' => 'string',
1295 1348 'default' => 'px',
1296 1349 ),
1297 - 'blockCustomWidthUnitMobile' => array(
1298 - 'type' => 'string',
1350 + 'blockCustomWidthUnitMobile' => array(
1351 + 'type' => 'string',
1299 1352 'default' => 'px',
1300 1353 ),
1301 - 'blockCustomWidthDecimalTablet' => array(
1302 - 'type' => 'number',
1354 + 'blockCustomWidthDecimalTablet' => array(
1355 + 'type' => 'number',
1303 1356 'default' => '',
1304 1357 ),
1305 - 'blockCustomWidthDecimalMobile' => array(
1306 - 'type' => 'number',
1358 + 'blockCustomWidthDecimalMobile' => array(
1359 + 'type' => 'number',
1307 1360 'default' => '',
1308 1361 ),
1309 - 'blockPosition' => array(
1310 - 'type' => 'string',
1362 + 'blockPosition' => array(
1363 + 'type' => 'string',
1311 1364 'default' => '',
1312 1365 ),
1313 - 'positionHorizontalOrientation' => array(
1314 - 'type' => 'string',
1366 + 'positionHorizontalOrientation' => array(
1367 + 'type' => 'string',
1315 1368 'default' => 'left',
1316 1369 ),
1317 - 'positionHorizontalOffset' => array(
1318 - 'type' => 'number',
1370 + 'positionHorizontalOffset' => array(
1371 + 'type' => 'number',
1319 1372 'default' => '',
1320 1373 ),
1321 - 'positionHorizontalOffsetUnit' => array(
1322 - 'type' => 'string',
1374 + 'positionHorizontalOffsetUnit' => array(
1375 + 'type' => 'string',
1323 1376 'default' => 'px',
1324 1377 ),
1325 - 'positionHorizontalOffsetDecimal' => array(
1326 - 'type' => 'number',
1378 + 'positionHorizontalOffsetDecimal' => array(
1379 + 'type' => 'number',
1327 1380 'default' => '',
1328 1381 ),
1329 - 'positionHorizontalOffsetTablet' => array(
1330 - 'type' => 'number',
1382 + 'positionHorizontalOffsetTablet' => array(
1383 + 'type' => 'number',
1331 1384 'default' => '',
1332 1385 ),
1333 - 'positionHorizontalOffsetMobile' => array(
1334 - 'type' => 'number',
1386 + 'positionHorizontalOffsetMobile' => array(
1387 + 'type' => 'number',
1335 1388 'default' => '',
1336 1389 ),
1337 - 'positionHorizontalOffsetUnitTablet' => array(
1338 - 'type' => 'string',
1390 + 'positionHorizontalOffsetUnitTablet' => array(
1391 + 'type' => 'string',
1339 1392 'default' => 'px',
1340 1393 ),
1341 - 'positionHorizontalOffsetUnitMobile' => array(
1342 - 'type' => 'string',
1394 + 'positionHorizontalOffsetUnitMobile' => array(
1395 + 'type' => 'string',
1343 1396 'default' => 'px',
1344 1397 ),
1345 - 'positionHorizontalOffsetDecimalTablet' => array(
1346 - 'type' => 'number',
1398 + 'positionHorizontalOffsetDecimalTablet' => array(
1399 + 'type' => 'number',
1347 1400 'default' => '',
1348 1401 ),
1349 - 'positionHorizontalOffsetDecimalMobile' => array(
1350 - 'type' => 'number',
1402 + 'positionHorizontalOffsetDecimalMobile' => array(
1403 + 'type' => 'number',
1351 1404 'default' => '',
1352 1405 ),
1353 - 'positionVerticalOrientation' => array(
1354 - 'type' => 'string',
1406 + 'positionVerticalOrientation' => array(
1407 + 'type' => 'string',
1355 1408 'default' => 'top',
1356 1409 ),
1357 - 'positionVerticalOffset' => array(
1358 - 'type' => 'number',
1410 + 'positionVerticalOffset' => array(
1411 + 'type' => 'number',
1359 1412 'default' => '',
1360 1413 ),
1361 - 'positionVerticalOffsetUnit' => array(
1362 - 'type' => 'string',
1414 + 'positionVerticalOffsetUnit' => array(
1415 + 'type' => 'string',
1363 1416 'default' => 'px',
1364 1417 ),
1365 - 'positionVerticalOffsetDecimal' => array(
1366 - 'type' => 'number',
1418 + 'positionVerticalOffsetDecimal' => array(
1419 + 'type' => 'number',
1367 1420 'default' => '',
1368 1421 ),
1369 - 'positionVerticalOffsetTablet' => array(
1370 - 'type' => 'number',
1422 + 'positionVerticalOffsetTablet' => array(
1423 + 'type' => 'number',
1371 1424 'default' => '',
1372 1425 ),
1373 - 'positionVerticalOffsetMobile' => array(
1374 - 'type' => 'number',
1426 + 'positionVerticalOffsetMobile' => array(
1427 + 'type' => 'number',
1375 1428 'default' => '',
1376 1429 ),
1377 - 'positionVerticalOffsetUnitTablet' => array(
1378 - 'type' => 'string',
1430 + 'positionVerticalOffsetUnitTablet' => array(
1431 + 'type' => 'string',
1379 1432 'default' => 'px',
1380 1433 ),
1381 - 'positionVerticalOffsetUnitMobile' => array(
1382 - 'type' => 'string',
1434 + 'positionVerticalOffsetUnitMobile' => array(
1435 + 'type' => 'string',
1383 1436 'default' => 'px',
1384 1437 ),
1385 - 'positionVerticalOffsetDecimalTablet' => array(
1386 - 'type' => 'number',
1438 + 'positionVerticalOffsetDecimalTablet' => array(
1439 + 'type' => 'number',
1387 1440 'default' => '',
1388 1441 ),
1389 - 'positionVerticalOffsetDecimalMobile' => array(
1390 - 'type' => 'number',
1442 + 'positionVerticalOffsetDecimalMobile' => array(
1443 + 'type' => 'number',
1391 1444 'default' => '',
1392 1445 ),
1393 - 'hideOnDesktop' => array(
1394 - 'type' => 'boolean',
1446 + 'hideOnDesktop' => array(
1447 + 'type' => 'boolean',
1395 1448 'default' => false,
1396 1449 ),
1397 - 'hideOnTablet' => array(
1398 - 'type' => 'boolean',
1450 + 'hideOnTablet' => array(
1451 + 'type' => 'boolean',
1399 1452 'default' => false,
1400 1453 ),
1401 - 'hideOnMobile' => array(
1402 - 'type' => 'boolean',
1454 + 'hideOnMobile' => array(
1455 + 'type' => 'boolean',
1403 1456 'default' => false,
1404 1457 ),
1405 1458 );
1406 1459 }
@@ -1418,9 +1471,9 @@
1418 1471 $container_ids = ! empty( $attributes['blockContainerIds'] ) ? $attributes['blockContainerIds'] : '';
1419 1472 $container_classes = ! empty( $attributes['blockContainerClasses'] ) ? $attributes['blockContainerClasses'] : '';
1420 1473 $container_data = isset( $attributes['blockContainerData'] ) && ! empty( $attributes['blockContainerData'] ) ? json_decode( $attributes['blockContainerData'], true ) : '';
1421 1474
1422 - $animation = ! empty( $container_data ) && isset( $container_data['data-animation'] ) ? $container_data['data-animation'] : '';
1475 + $animation = ! empty( $container_data ) && isset( $container_data['data-animation'] ) ? sanitize_text_field( $container_data['data-animation'] ) : '';
1423 1476
1424 1477 $html_attributes = qi_blocks_get_id_attribute( $container_ids );
1425 1478 $html_attributes .= ' ' . qi_blocks_get_class_attribute( $container_classes );
1426 1479 $html_attributes .= ' ' . qi_blocks_get_inline_attr( $animation, 'data-animation' );
@@ -1507,12 +1560,12 @@
1507 1560 } else {
1508 1561 $partial_value = 0;
1509 1562 }
1510 1563
1511 - $sliderNavigationPosition = isset( $atts['sliderNavigationPosition'] ) ? $atts['sliderNavigationPosition'] : '';
1512 - $sliderPaginationPosition = isset( $atts['sliderPaginationPosition'] ) ? $atts['sliderPaginationPosition'] : '';
1564 + $slider_navigation_position = isset( $atts['sliderNavigationPosition'] ) ? $atts['sliderNavigationPosition'] : '';
1565 + $slider_pagination_position = isset( $atts['sliderPaginationPosition'] ) ? $atts['sliderPaginationPosition'] : '';
1513 1566
1514 - if ( ( 'outside' === $sliderNavigationPosition || 'together' === $sliderNavigationPosition ) || 'outside' === $sliderPaginationPosition ) {
1567 + if ( ( 'outside' === $slider_navigation_position || 'together' === $slider_navigation_position ) || 'outside' === $slider_pagination_position ) {
1515 1568 $data['unique'] = isset( $atts['uniqueClass'] ) ? $atts['uniqueClass'] : '';
1516 1569 }
1517 1570
1518 1571 $data['direction'] = isset( $atts['sliderDirection'] ) ? $atts['sliderDirection'] : 'horizontal';
@@ -1540,9 +1593,9 @@
1540 1593 $data['slidesPerView680'] = ! empty( $atts['sliderColumns680'] ) ? $atts['sliderColumns680'] : $atts['sliderColumns'];
1541 1594 $data['slidesPerView480'] = ! empty( $atts['sliderColumns480'] ) ? $atts['sliderColumns480'] : $atts['sliderColumns'];
1542 1595 }
1543 1596
1544 - return json_encode( $data );
1597 + return wp_json_encode( $data );
1545 1598 }
1546 1599 }
1547 1600
1548 1601 if ( ! function_exists( 'qi_blocks_get_additional_query_args' ) ) {
@@ -1576,8 +1629,9 @@
1576 1629 $taxonomy_values['terms'] = $slug;
1577 1630 }
1578 1631
1579 1632 if ( ! empty( $atts['tax'] ) && ! empty( $taxonomy_values ) ) {
1633 + // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query
1580 1634 $args['tax_query'] = array( array_merge( array( 'taxonomy' => $atts['tax'] ), $taxonomy_values ) );
1581 1635 }
1582 1636 }
1583 1637
@@ -1601,16 +1655,17 @@
1601 1655 global $wpdb;
1602 1656 $attachment_id = '';
1603 1657
1604 1658 if ( '' !== $attachment_url ) {
1605 -
1659 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery
1606 1660 $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid=%s", $attachment_url ) );
1607 1661
1608 - // Additional check for undefined reason when guid is not image src
1662 + // Additional check for undefined reason when guid is not image src.
1609 1663 if ( empty( $attachment_id ) ) {
1610 1664 $modified_url = substr( $attachment_url, strrpos( $attachment_url, '/' ) + 1 );
1611 1665
1612 - //get attachment id
1666 + // get attachment id.
1667 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery
1613 1668 $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_wp_attached_file' AND meta_value LIKE %s", '%' . $modified_url . '%' ) );
1614 1669 }
1615 1670 }
1616 1671
@@ -1669,35 +1724,35 @@
1669 1724 }
1670 1725
1671 1726 if ( ! empty( $attachment_id ) && ( isset( $width ) && isset( $height ) ) ) {
1672 1727
1673 - //get file path of the attachment
1728 + // Get file path of the attachment.
1674 1729 $img_path = get_attached_file( $attachment_id );
1675 1730
1676 - //get attachment url
1731 + // Get attachment url.
1677 1732 $img_url = wp_get_attachment_url( $attachment_id );
1678 1733
1679 - //break down img path to array, so we can use its components in building thumbnail path
1734 + // Break down img path to array, so we can use its components in building thumbnail path.
1680 1735 $img_path_array = pathinfo( $img_path );
1681 1736
1682 - //build thumbnail path
1737 + // build thumbnail path.
1683 1738 $new_img_path = $img_path_array['dirname'] . '/' . $img_path_array['filename'] . '-' . $width . 'x' . $height . '.' . $img_path_array['extension'];
1684 1739
1685 - //build thumbnail url
1740 + // build thumbnail url.
1686 1741 $new_img_url = str_replace( $img_path_array['filename'], $img_path_array['filename'] . '-' . $width . 'x' . $height, $img_url );
1687 1742
1688 - //check if thumbnail exists by its path
1743 + // check if thumbnail exists by its path.
1689 1744 if ( ! file_exists( $new_img_path ) ) {
1690 - //get image manipulation object
1745 + // get image manipulation object.
1691 1746 $image_object = wp_get_image_editor( $img_path );
1692 1747
1693 1748 if ( ! is_wp_error( $image_object ) ) {
1694 - //resize image and save it new to path
1749 + // resize image and save it new to path.
1695 1750 $image_object->resize( $width, $height, $crop );
1696 1751 $image_object->save( $new_img_path );
1697 1752
1698 - //get sizes of newly created thumbnail.
1699 - ///we don't use $width and $height because those might differ from end result based on $crop parameter
1753 + // get sizes of newly created thumbnail.
1754 + // we don't use $width and $height because those might differ from end result based on $crop parameter.
1700 1755 $image_sizes = $image_object->get_size();
1701 1756
1702 1757 $width = $image_sizes['width'];
1703 1758 $height = $image_sizes['height'];
@@ -1703,9 +1758,9 @@
1703 1758 $height = $image_sizes['height'];
1704 1759 }
1705 1760 }
1706 1761
1707 - //generate data to be returned
1762 + // generate data to be returned.
1708 1763 $return_array = array(
1709 1764 'img_url' => $new_img_url,
1710 1765 'img_width' => $width,
1711 1766 'img_height' => $height,
@@ -1710,11 +1765,11 @@
1710 1765 'img_width' => $width,
1711 1766 'img_height' => $height,
1712 1767 );
1713 1768
1714 - //attachment wasn't found in gallery, but it is not empty
1769 + // attachment wasn't found in gallery, but it is not empty.
1715 1770 } elseif ( '' !== $attachment && ( isset( $width ) && isset( $height ) ) ) {
1716 - //generate data to be returned
1771 + // generate data to be returned.
1717 1772 $return_array = array(
1718 1773 'img_url' => $attachment,
1719 1774 'img_width' => $width,
1720 1775 'img_height' => $height,
@@ -1806,9 +1861,8 @@
1806 1861 *
1807 1862 * @param array $dependency
1808 1863 *
1809 1864 * @return array
1810 - *
1811 1865 */
1812 1866 function qi_blocks_main_editor_additional_dependencies( $dependency ) {
1813 1867 global $pagenow;
1814 1868
@@ -1819,5 +1873,39 @@
1819 1873 return $dependency;
1820 1874 }
1821 1875
1822 1876 add_filter( 'qi_blocks_filter_main_editor_dependencies', 'qi_blocks_main_editor_additional_dependencies' );
1877 +}
1878 +
1879 +if ( ! function_exists( 'qi_blocks_escape_title_tag' ) ) {
1880 + /**
1881 + * Function that escape title tag variable for modules
1882 + *
1883 + * @param string $title_tag
1884 + *
1885 + * @return string
1886 + */
1887 + function qi_blocks_escape_title_tag( $title_tag ) {
1888 + $allowed_tags = array(
1889 + 'h1',
1890 + 'h2',
1891 + 'h3',
1892 + 'h4',
1893 + 'h5',
1894 + 'h6',
1895 + 'p',
1896 + 'span',
1897 + 'ul',
1898 + 'ol',
1899 + 'div',
1900 + );
1901 +
1902 + $escaped_title_tag = '';
1903 + $title_tag = strtolower( sanitize_key( $title_tag ) );
1904 +
1905 + if ( in_array( $title_tag, $allowed_tags, true ) ) {
1906 + $escaped_title_tag = $title_tag;
1907 + }
1908 +
1909 + return $escaped_title_tag;
1910 + }
1823 1911 }