PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
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 10.11 All 204 releases
← All changes | includes/_toolbar_ui/ui__form_steps_timeline.php +12 -4 11.211.8.4 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * Templates functions for showing Steps Timeline in Booking form and in Wizard.
4 4 *
@@ -142,12 +142,20 @@
142 142 }
143 143 $new_html = '<span class="wpbc_steps_for_timeline__'.esc_attr($shortcode_text_to_replace).'">';
144 144 $new_html .= wpbc_ui__steps_timeline__get_html( $steps_count, $step_number );
145 145 $new_html .= '</span>';
146 - if ( isset( $shortcode_params_arr['params']['color'] ) ) {
147 - $color = esc_attr( $shortcode_params_arr['params']['color'] );
148 - $new_html .= '<style type="text/css"> .booking_form_div .wpbc_steps_for_timeline__'.esc_attr($shortcode_text_to_replace).' .wpbc_steps_for_timeline_container { --wpbc_steps_for_timeline_active_color: ' . $color . '; } </style>';
149 - }
146 + if ( isset( $shortcode_params_arr['params']['color'] ) ) {
147 + $raw_color = sanitize_text_field( (string) $shortcode_params_arr['params']['color'] );
148 + // Read compatibility for forms exported by early 11.5 development builds.
149 + if ( 'accent' === $raw_color ) {
150 + $color = 'var(--wpbc_form-accent-color, var(--wpbc_timepicker-selected-bg-color, #6b96ce))';
151 + } else {
152 + $color = sanitize_hex_color( $raw_color );
153 + }
154 + if ( $color ) {
155 + $new_html .= '<style type="text/css"> .booking_form_div .wpbc_steps_for_timeline__' . esc_attr( $shortcode_text_to_replace ) . ' .wpbc_steps_for_timeline_container { --wpbc_steps_for_timeline_active_color: ' . esc_html( $color ) . '; } </style>';
156 + }
157 + }
150 158 $string = str_replace( '[' . $shortcode_text_to_replace . ']', $new_html, $string );
151 159 }
152 160
153 161 return $string;