PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
← All changes | includes/page-form-builder/bfb-schemas.php +13 -6 11.4.2 → 11.9 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * Hybrid++ Schemas utilities: normalize/validate/merge/extract.
4 4 *
@@ -65,9 +65,9 @@
65 65
66 66 // Allow extra prop/control types used by the Inspector Factory.
67 67 $allowed_prop_types = array( 'string', 'number', 'boolean', 'array', 'int', 'float', 'enum', 'color' );
68 68 // Expanded to support Factory extras and color control.
69 - $allowed_control_types = array( 'text', 'number', 'checkbox', 'textarea', 'select', 'range_number', 'len', 'color' );
69 + $allowed_control_types = array( 'text', 'number', 'checkbox', 'textarea', 'select', 'range_number', 'len', 'color', 'slot' );
70 70
71 71 // Validate prop meta.
72 72 foreach ( $pack['schema']['props'] as $prop_key => $meta ) {
73 73
@@ -102,13 +102,20 @@
102 102 if ( ! is_array( $control ) ) {
103 103 unset( $group['controls'][ $c_i ] );
104 104 continue;
105 105 }
106 - if ( empty( $control['key'] ) || empty( $control['type'] ) || ! in_array( $control['type'], $allowed_control_types, true ) ) {
107 - unset( $group['controls'][ $c_i ] );
108 - continue;
109 - }
110 - // Remove objects in control meta.
106 + if ( empty( $control['key'] ) || empty( $control['type'] ) || ! in_array( $control['type'], $allowed_control_types, true ) ) {
107 + unset( $group['controls'][ $c_i ] );
108 + continue;
109 + }
110 + if ( 'slot' === $control['type'] ) {
111 + $control['slot'] = isset( $control['slot'] ) ? sanitize_key( $control['slot'] ) : '';
112 + if ( '' === $control['slot'] ) {
113 + unset( $group['controls'][ $c_i ] );
114 + continue;
115 + }
116 + }
117 + // Remove objects in control meta.
111 118 foreach ( $control as $k => $v ) {
112 119 if ( is_object( $v ) && ! ( $v instanceof JsonSerializable ) ) {
113 120 unset( $control[ $k ] );
114 121 }