PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.8.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.8.2
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
betterdocs / views / widgets / code-snippet.php

code-snippet.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.8.2, at views/widgets/code-snippet.php

37 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6 /**
7 * Template for BetterDocs Code Snippet Widget
8 *
9 * @var string $code_content
10 * @var string $language
11 * @var bool $show_copy_button
12 * @var bool $show_line_numbers
13 * @var string $theme
14 * @var string $widget_type
15 */
16
17 if ( empty( $code_content ) ) {
18 return;
19 }
20
21 // Use the template part for consistent rendering (block + Elementor share it).
22 $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 : '',
36 ] );
37