| @@ -1,9 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | - exit; | |
| 5 | -} | |
| 6 | 2 | /** |
| 7 | 3 | * Template for BetterDocs Code Snippet Widget |
| 8 | 4 | * |
| 9 | 5 | * @var string $code_content |
| @@ -17,20 +13,13 @@ | ||
| 17 | 13 | if ( empty( $code_content ) ) { |
| 18 | 14 | return; |
| 19 | 15 | } |
| 20 | 16 | |
| 21 | -// Use the template part for consistent rendering (block + Elementor share it). | |
| 17 | +// Use the template part for consistent rendering | |
| 22 | 18 | $view_object->get( 'templates/parts/code-snippet', [ |
| 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 : '', | |
| 19 | + 'code_content' => $code_content, | |
| 20 | + 'language' => $language, | |
| 21 | + 'show_copy_button' => $show_copy_button, | |
| 22 | + 'show_line_numbers' => $show_line_numbers, | |
| 23 | + 'theme' => $theme, | |
| 24 | + 'widget_type' => $widget_type, | |
| 36 | 25 | ] ); |