-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmarkdown.php
78 lines (57 loc) · 1.5 KB
/
markdown.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Markdown Template
*
* @link https://guides.github.com/features/mastering-markdown/
* @author Pronamic <[email protected]>
* @copyright 2005-2022 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Documentor
*/
namespace Pronamic\WordPress\Documentor;
if ( ! isset( $documentor ) ) {
return;
}
$actions = $documentor->get_actions();
$filters = $documentor->get_filters();
$eol = "\n";
echo '# Hooks', $eol;
echo $eol;
echo '- [Actions](#actions)', $eol;
echo '- [Filters](#filters)', $eol;
echo $eol;
echo '## Actions', $eol;
echo $eol;
if ( empty( $actions ) ) {
echo '*This project does not contain any WordPress actions.*', $eol;
echo $eol;
} else {
foreach ( $actions as $hook ) {
include __DIR__ . '/parts/markdown-hook.php';
}
}
echo '## Filters', $eol;
echo $eol;
if ( empty( $filters ) ) {
echo '*This project does not contain any WordPress filters.*', $eol;
echo $eol;
} else {
foreach ( $filters as $hook ) {
include __DIR__ . '/parts/markdown-hook.php';
}
}
echo $eol;
echo '<p align="center">';
printf(
'<a href="%s"><img src="%s" alt="Pronamic WordPress Documentor" width="32" height="32"></a>',
'https://github.com/pronamic/wp-documentor',
'https://cdn.jsdelivr.net/gh/pronamic/wp-documentor@main/logos/pronamic-wp-documentor.svgo-min.svg'
);
echo '<br>';
printf(
'<em>Generated by <a href="%s">Pronamic WordPress Documentor</a> <code>%s</code></em>',
'https://github.com/pronamic/wp-documentor',
'1.2.0'
);
echo '<p>';
echo $eol;