-
Notifications
You must be signed in to change notification settings - Fork 28
/
kind-like.php
53 lines (48 loc) · 1.19 KB
/
kind-like.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
<?php
/*
* Like Template
*
*/
$mf2_post = new MF2_Post( get_the_ID() );
$cite = $mf2_post->fetch();
if ( ! $cite ) {
return;
}
$author = Kind_View::get_hcard( ifset( $cite['author'] ) );
$url = $cite['url'];
$embed = self::get_embed( $url );
?>
<section class="response u-like-of h-cite">
<header>
<?php
echo Kind_Taxonomy::get_before_kind( 'like' );
if ( ! $embed ) {
if ( ! array_key_exists( 'name', $cite ) ) {
$cite['name'] = self::get_post_type_string( $url );
}
if ( isset( $url ) ) {
echo sprintf( '<a href="%1s" class="p-name u-url">%2s</a>', $url, $cite['name'] );
} else {
echo sprintf( '<span class="p-name">%1s</span>', $cite['name'] );
}
if ( $author ) {
echo ' ' . __( 'by', 'indieweb-post-kinds' ) . ' ' . $author;
}
if ( array_key_exists( 'publication', $cite ) ) {
echo sprintf( ' <em>(<span class="p-publication">%1s</span>)</em>', $cite['publication'] );
}
}
?>
</header>
<?php
if ( $cite ) {
if ( $embed ) {
echo sprintf( '<blockquote class="e-summary">%1s</blockquote>', $embed );
} elseif ( array_key_exists( 'summary', $cite ) ) {
echo sprintf( '<blockquote class="e-summary">%1s</blockquote>', $cite['summary'] );
}
}
// Close Response
?>
</section>
<?php