fictioneer/partials/_bookmarks.php

35 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2023-01-21 01:31:34 +01:00
<?php
/**
* Partial: Bookmarks
*
* Renders the HTML required for the script-generated bookmark cards.
*
* @package WordPress
* @subpackage Fictioneer
* @since 4.0.0
2023-01-21 01:31:34 +01:00
*
2023-08-19 22:22:56 +02:00
* @internal $args['show_empty'] Whether to render a note when empty or nothing at all.
* @internal $args['count'] Maximum number of bookmarks to render.
2024-05-15 11:35:14 +02:00
* @internal $args['seamless'] Whether to render the image seamless. Default false (Customizer).
* @internal $args['thumbnail'] Whether the image is rendered. Default true (Customizer).
2023-01-21 01:31:34 +01:00
*/
// No direct access!
defined( 'ABSPATH' ) OR exit;
2023-01-21 01:31:34 +01:00
// Setup
$show_empty = isset( $args['show_empty'] ) && $args['show_empty'];
$count = isset( $args['count'] ) ? intval( $args['count'] ) : -1;
2024-05-19 14:30:44 +02:00
fictioneer_get_cached_partial( 'partials/_template_bookmark', '', null, null, $args );
2023-01-21 01:31:34 +01:00
?>
2023-01-21 01:31:34 +01:00
2024-12-06 17:38:32 +01:00
<section class="small-card-block bookmarks-block <?php echo $show_empty ? '' : 'hidden' ?>" data-count="<?php echo $count; ?>" data-fictioneer-bookmarks-target="shortcodeBlock">
2023-01-21 01:31:34 +01:00
<?php if ( $show_empty ) : ?>
2024-12-06 17:38:32 +01:00
<div class="bookmarks-block__no-bookmarks no-results" data-fictioneer-bookmarks-target="noBookmarksNote"><?php echo fcntr( 'no_bookmarks' ); ?></div>
2023-01-21 01:31:34 +01:00
<?php endif; ?>
<ul class="grid-columns"></ul>
2023-01-21 01:31:34 +01:00
</section>