Files
wp-fedistream/templates/archive/playlist.php
magdev 379fd23be0
All checks were successful
Create Release Package / build-release (push) Successful in 55s
feat: Replace Twig with native PHP templates
- Remove twig/twig dependency from composer.json
- Convert all 25 Twig templates to native PHP templates
- New render() method in Plugin.php using PHP include with output buffering
- New render_partial() helper method for including partials
- Templates support theme overrides via fedistream/ directory
- Reduced plugin size by eliminating Twig and its dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:48:10 +01:00

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>