forked from krogsgard/wporg-developer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-wp-parser-hook.php
84 lines (71 loc) · 2.34 KB
/
content-wp-parser-hook.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
79
80
81
82
83
84
<?php namespace DevHub; ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1><a href="<?php the_permalink() ?>"><?php echo get_signature(); ?></a></h1>
<section class="description">
<?php the_excerpt(); ?>
</section>
<section class="long-description">
<?php the_content(); ?>
</section>
<?php
$since = get_since();
if ( ! empty( $since ) ) : ?>
<section class="since">
<p><strong><?php _e( 'Since:</strong> WordPress' ); ?> <a href="<?php echo get_since_link( $since ); ?>"><?php echo esc_html( $since ); ?></a></p>
</section>
<?php endif; ?>
<?php
$source_file = get_source_file();
if ( ! empty( $source_file ) ) : ?>
<section class="source">
<p><strong><?php _e( 'Source:', 'wporg' ); ?></strong> <a href="<?php echo get_source_file_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a></p>
</section>
<?php endif; ?>
<?php /* if ( is_archive() ) : ?>
<section class="meta">Used by TODO | Uses TODO | TODO Examples</section>
<?php endif; */ ?>
<?php if ( is_single() ) : ?>
<!--
<hr/>
<section class="explanation">
<h2><?php _e( 'Explanation', 'wporg' ); ?></h2>
</section>
-->
<?php if ( $params = get_params() ) : ?>
<hr/>
<section class="parameters">
<h2><?php _e( 'Parameters', 'wporg-developer' ); ?></h2>
<dl>
<?php foreach ( $params as $param ) : ?>
<?php if ( ! empty( $param['variable'] ) ) : ?>
<dt><?php echo esc_html( $param['variable'] ); ?></dt>
<?php endif; ?>
<dd>
<p class="desc">
<?php if ( ! empty( $param['types'] ) ) : ?>
<span class="type">(<?php echo wp_kses_post( $param['types'] ); ?>)</span>
<?php endif; ?>
<?php if ( ! empty( $param['content'] ) ) : ?>
<span class="description"><?php echo wp_kses_post( $param['content'] ); ?></span>
<?php endif; ?>
</p>
<?php if ( ! empty( $param['default'] ) ) : ?>
<p class="default"><?php _e( 'Default value:', 'wporg' );?> <?php echo esc_html( $param['default'] ); ?></p>
<?php endif; ?>
</dd>
<?php endforeach; ?>
</dl>
</section>
<?php endif; ?>
<hr/>
<!--
<section class="learn-more">
<h2><?php _e( 'Learn More', 'wporg' ); ?></h2>
</section>
<hr/>
<section class="examples">
<h2><?php _e( 'Examples', 'wporg' ); ?></h2>
</section>
-->
<?php endif; ?>
</article>