| @@ -17,13 +17,20 @@ | ||
| 17 | 17 | if ( empty( $code_content ) ) { |
| 18 | 18 | return; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -// Use the template part for consistent rendering | |
| 21 | +// Use the template part for consistent rendering (block + Elementor share it). | |
| 22 | 22 | $view_object->get( 'templates/parts/code-snippet', [ |
| 23 | - 'code_content' => $code_content, | |
| 24 | - 'language' => $language, | |
| 25 | - 'show_copy_button' => $show_copy_button, | |
| 26 | - 'show_line_numbers' => $show_line_numbers, | |
| 27 | - 'theme' => $theme, | |
| 28 | - 'widget_type' => $widget_type, | |
| 23 | + 'code_content' => $code_content, | |
| 24 | + 'language' => $language, | |
| 25 | + 'code_variants' => isset( $code_variants ) ? $code_variants : [], | |
| 26 | + 'show_copy_button' => $show_copy_button, | |
| 27 | + 'show_header' => isset( $show_header ) ? $show_header : true, | |
| 28 | + 'show_line_numbers' => $show_line_numbers, | |
| 29 | + 'show_language_label' => isset( $show_language_label ) ? $show_language_label : true, | |
| 30 | + 'theme' => $theme, | |
| 31 | + 'widget_type' => $widget_type, | |
| 32 | + 'file_name' => isset( $file_name ) ? $file_name : '', | |
| 33 | + 'show_traffic_lights' => isset( $show_traffic_lights ) ? $show_traffic_lights : true, | |
| 34 | + 'show_file_icon' => isset( $show_file_icon ) ? $show_file_icon : true, | |
| 35 | + 'file_icon' => isset( $file_icon ) ? $file_icon : '', | |
| 29 | 36 | ] ); |