PluginProbe
ActivityPub / 5.7.0
ActivityPub v5.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / templates / reply-embed.php

reply-embed.php in ActivityPub 5.7.0, at templates/reply-embed.php

82 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Reply embed template.
4 *
5 * @package Activitypub
6 */
7
8 /* @var array $args Template arguments. */
9 $args = wp_parse_args(
10 $args,
11 array(
12 'avatar_url' => '',
13 'author_name' => '',
14 'author_url' => '',
15 'title' => '',
16 'content' => '',
17 'image' => '',
18 'published' => '',
19 'url' => '',
20 'boosts' => null,
21 'favorites' => null,
22 'webfinger' => '',
23 )
24 );
25
26 \wp_enqueue_style( 'activitypub-embed', ACTIVITYPUB_PLUGIN_URL . 'assets/css/activitypub-embed.css', array(), ACTIVITYPUB_PLUGIN_VERSION );
27 ?>
28
29 <div class="activitypub-embed u-in-reply-to h-cite">
30 <div class="activitypub-embed-header p-author h-card">
31 <?php if ( $args['avatar_url'] ) : ?>
32 <img class="u-photo" src="<?php echo \esc_url( $args['avatar_url'] ); ?>" alt="" />
33 <?php endif; ?>
34 <div class="activitypub-embed-header-text">
35 <h2 class="p-name"><?php echo \esc_html( $args['author_name'] ); ?></h2>
36 <?php if ( $args['author_url'] ) : ?>
37 <a href="<?php echo \esc_url( $args['author_url'] ); ?>" class="ap-account u-url"><?php echo \esc_html( $args['webfinger'] ?? $args['author_url'] ); ?></a>
38 <?php endif; ?>
39 </div>
40 </div>
41
42 <div class="activitypub-embed-content">
43 <?php if ( $args['title'] ) : ?>
44 <h3 class="ap-title p-name"><?php echo \esc_html( $args['title'] ); ?></h3>
45 <?php endif; ?>
46
47 <?php if ( $args['content'] ) : ?>
48 <div class="ap-subtitle p-summary e-content"><?php echo \wp_kses_post( $args['content'] ); ?></div>
49 <?php endif; ?>
50
51 <?php if ( $args['image'] ) : ?>
52 <div class="ap-preview">
53 <img class="u-photo u-featured" src="<?php echo \esc_url( $args['image'] ); ?>" alt="" />
54 </div>
55 <?php endif; ?>
56 </div>
57
58 <div class="activitypub-embed-meta">
59 <?php if ( $args['published'] ) : ?>
60 <a href="<?php echo \esc_url( $args['url'] ); ?>" class="ap-stat ap-date dt-published u-in-reply-to"><?php echo \esc_html( $args['published'] ); ?></a>
61 <?php endif; ?>
62
63 <?php if ( null !== $args['boosts'] ) : ?>
64 <span class="ap-stat">
65 <?php
66 /* translators: %s: number of boosts */
67 printf( \esc_html__( '%s boosts', 'activitypub' ), '<strong>' . \esc_html( $args['boosts'] ) . '</strong>' );
68 ?>
69 </span>
70 <?php endif; ?>
71
72 <?php if ( null !== $args['favorites'] ) : ?>
73 <span class="ap-stat">
74 <?php
75 /* translators: %s: number of favorites */
76 printf( \esc_html__( '%s favorites', 'activitypub' ), '<strong>' . \esc_html( $args['favorites'] ) . '</strong>' );
77 ?>
78 </span>
79 <?php endif; ?>
80 </div>
81 </div>
82