You've already forked wp-fedistream
37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
|
|
<?php
|
||
|
|
/**
|
||
|
|
* Artists grid shortcode template.
|
||
|
|
*
|
||
|
|
* @package WP_FediStream
|
||
|
|
*
|
||
|
|
* @var array $posts Array of artist data.
|
||
|
|
* @var int $columns Number of columns.
|
||
|
|
* @var string $title Section title.
|
||
|
|
*/
|
||
|
|
|
||
|
|
// Prevent direct file access.
|
||
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
|
||
|
|
$plugin = \WP_FediStream\Plugin::get_instance();
|
||
|
|
$columns = $columns ?? 4;
|
||
|
|
?>
|
||
|
|
<div class="fedistream-shortcode fedistream-shortcode--artists">
|
||
|
|
<?php if ( ! empty( $title ) ) : ?>
|
||
|
|
<h3 class="fedistream-shortcode__title"><?php echo esc_html( $title ); ?></h3>
|
||
|
|
<?php endif; ?>
|
||
|
|
|
||
|
|
<?php if ( ! empty( $posts ) && is_array( $posts ) ) : ?>
|
||
|
|
<div class="fedistream-grid fedistream-grid--artists fedistream-grid--cols-<?php echo esc_attr( $columns ); ?>">
|
||
|
|
<?php foreach ( $posts as $post ) : ?>
|
||
|
|
<?php echo $plugin->render_partial( 'partials/card-artist', array( 'post' => $post ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</div>
|
||
|
|
<?php else : ?>
|
||
|
|
<div class="fedistream-empty">
|
||
|
|
<p><?php esc_html_e( 'No artists found.', 'wp-fedistream' ); ?></p>
|
||
|
|
</div>
|
||
|
|
<?php endif; ?>
|
||
|
|
</div>
|