| @@ -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; |