You've already forked wp-fedistream
50 lines
1.8 KiB
PHP
50 lines
1.8 KiB
PHP
|
|
<?php
|
||
|
|
/**
|
||
|
|
* Playlist archive template.
|
||
|
|
*
|
||
|
|
* @package WP_FediStream
|
||
|
|
*
|
||
|
|
* @var array $posts Array of playlist data.
|
||
|
|
* @var string $archive_title Archive title.
|
||
|
|
* @var string $archive_description Archive description.
|
||
|
|
* @var array $pagination Pagination data.
|
||
|
|
*/
|
||
|
|
|
||
|
|
// Prevent direct file access.
|
||
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
$plugin = \WP_FediStream\Plugin::get_instance();
|
||
|
|
?>
|
||
|
|
<div class="fedistream-archive fedistream-archive--playlists">
|
||
|
|
<header class="fedistream-archive__header">
|
||
|
|
<h1 class="fedistream-archive__title"><?php esc_html_e( 'Playlists', 'wp-fedistream' ); ?></h1>
|
||
|
|
<?php if ( ! empty( $archive_description ) ) : ?>
|
||
|
|
<div class="fedistream-archive__description"><?php echo wp_kses_post( $archive_description ); ?></div>
|
||
|
|
<?php endif; ?>
|
||
|
|
</header>
|
||
|
|
|
||
|
|
<?php if ( ! empty( $posts ) && is_array( $posts ) ) : ?>
|
||
|
|
<div class="fedistream-grid fedistream-grid--playlists">
|
||
|
|
<?php foreach ( $posts as $post ) : ?>
|
||
|
|
<?php echo $plugin->render_partial( 'partials/card-playlist', array( 'post' => $post ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<?php if ( ! empty( $pagination['links'] ) ) : ?>
|
||
|
|
<nav class="fedistream-pagination">
|
||
|
|
<?php
|
||
|
|
foreach ( $pagination['links'] as $link ) {
|
||
|
|
echo $link; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
</nav>
|
||
|
|
<?php endif; ?>
|
||
|
|
<?php else : ?>
|
||
|
|
<div class="fedistream-empty">
|
||
|
|
<p><?php esc_html_e( 'No playlists found.', 'wp-fedistream' ); ?></p>
|
||
|
|
</div>
|
||
|
|
<?php endif; ?>
|
||
|
|
</div>
|