3
3
if (!function_exists ('wpkirk_toc ' )) {
4
4
5
5
/**
6
- * Table of Contents
6
+ * Generates a Table of Contents (TOC) based on the sections in the buffer.
7
+ *
8
+ * This function scans the output buffer for section headers and generates a TOC.
9
+ * The TOC is then displayed at the beginning of the content.
10
+ *
11
+ * @return void
7
12
*/
8
13
function wpkirk_toc ()
9
14
{
@@ -35,7 +40,14 @@ function wpkirk_toc()
35
40
if (!function_exists ('wpkirk_output ' )) {
36
41
37
42
/**
38
- * Output
43
+ * Outputs the result of a function within a details HTML element.
44
+ *
45
+ * This function executes the provided function and displays its output
46
+ * within a details HTML element. The output is formatted based on the specified language.
47
+ *
48
+ * @param callable|string $func The function to execute or the code to evaluate.
49
+ * @param string $language The language for syntax highlighting (default: 'json').
50
+ * @return void
39
51
*/
40
52
function wpkirk_output ($ func , $ language = 'json ' )
41
53
{
@@ -50,7 +62,14 @@ function wpkirk_output($func, $language = 'json')
50
62
if (!function_exists ('wpkirk_section ' )) {
51
63
52
64
/**
53
- * Section
65
+ * Outputs a section header with the specified ID and content.
66
+ *
67
+ * This function generates an H2 header with the specified ID and content.
68
+ * The content can be a string or a callable function.
69
+ *
70
+ * @param string $id The ID for the section header.
71
+ * @param string|callable $strFunc The content for the section header.
72
+ * @return void
54
73
*/
55
74
function wpkirk_section ($ id , $ strFunc )
56
75
{
@@ -68,7 +87,14 @@ function wpkirk_section($id, $strFunc)
68
87
if (!function_exists ('wpkirk_code ' )) {
69
88
70
89
/**
71
- * Code
90
+ * Outputs code within a preformatted code block.
91
+ *
92
+ * This function displays the provided code within a preformatted code block
93
+ * with syntax highlighting based on the specified language.
94
+ *
95
+ * @param string $language The language for syntax highlighting (default: 'php').
96
+ * @param string $func The code to display.
97
+ * @return void
72
98
*/
73
99
function wpkirk_code ($ language = 'php ' , $ func = '' )
74
100
{
@@ -81,7 +107,15 @@ function wpkirk_code($language = 'php', $func = '')
81
107
if (!function_exists ('wpkirk_execute_code ' )) {
82
108
83
109
/**
84
- * Execute Code
110
+ * Executes the provided code and outputs the result within a preformatted code block.
111
+ *
112
+ * This function executes the provided code (either a callable function or a string)
113
+ * and displays the result within a preformatted code block with syntax highlighting
114
+ * based on the specified language.
115
+ *
116
+ * @param string $language The language for syntax highlighting (default: 'php').
117
+ * @param callable|string $func The function to execute or the code to evaluate.
118
+ * @return void
85
119
*/
86
120
function wpkirk_execute_code ($ language = 'php ' , $ func = '' )
87
121
{
0 commit comments