2023-01-21 01:31:34 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Template Part: Footer
|
|
|
|
*
|
|
|
|
* Closes the site container and includes the breadcrumbs, footer menu, cookie
|
|
|
|
* consent banner, TTS interface, application wide icons, and HTML footer.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Fictioneer
|
|
|
|
* @since 3.0
|
|
|
|
* @see fictioneer_get_breadcrumbs()
|
|
|
|
* @see fictioneer_get_footer_copyright_note()
|
|
|
|
* @see partials/_tts-interface.php
|
|
|
|
* @see partials/_consent-banner.php
|
|
|
|
* @see wp_footer()
|
|
|
|
*
|
2023-08-20 01:04:49 +02:00
|
|
|
* @internal $args['post_id'] Optional. Current post ID.
|
|
|
|
* @internal $args['post_type'] Optional. Current post type.
|
|
|
|
* @internal $args['breadcrumbs'] Array of breadcrumb tuples with label (0) and link (1).
|
2023-01-21 01:31:34 +01:00
|
|
|
*/
|
|
|
|
?>
|
|
|
|
|
2023-08-03 20:29:19 +02:00
|
|
|
<?php
|
|
|
|
|
2023-08-04 00:54:41 +02:00
|
|
|
// IDs
|
|
|
|
$page_id = get_queried_object_id();
|
|
|
|
|
|
|
|
if ( $page_id != $args['post_id'] ) {
|
|
|
|
$args['post_id'] = $page_id;
|
|
|
|
}
|
|
|
|
|
2023-08-03 20:29:19 +02:00
|
|
|
// Null post ID for generated pages
|
|
|
|
if ( is_archive() || is_search() || is_404() ) {
|
|
|
|
$args['post_id'] = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hook after #main closes
|
|
|
|
do_action( 'fictioneer_after_main', $args );
|
|
|
|
|
|
|
|
?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
|
|
|
<footer class="footer layout-links">
|
|
|
|
<div class="footer__wrapper">
|
|
|
|
<?php do_action( 'fictioneer_site_footer', $args ); ?>
|
|
|
|
</div>
|
|
|
|
</footer>
|
2023-08-03 20:29:19 +02:00
|
|
|
</div> <!-- #site -->
|
2023-01-21 01:31:34 +01:00
|
|
|
|
|
|
|
<?php
|
|
|
|
// Render TTS interface if required
|
|
|
|
if (
|
2023-08-03 19:56:25 +02:00
|
|
|
! empty( $args['post_id'] ) &&
|
|
|
|
$args['post_type'] == 'fcn_chapter' &&
|
2023-01-21 01:31:34 +01:00
|
|
|
! post_password_required()
|
|
|
|
) {
|
|
|
|
get_template_part( 'partials/_tts-interface' );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Render cookie banner HTML if required
|
2023-08-03 19:56:25 +02:00
|
|
|
if ( get_option( 'fictioneer_cookie_banner' ) ) {
|
|
|
|
get_template_part( 'partials/_consent-banner' );
|
|
|
|
}
|
2023-01-21 01:31:34 +01:00
|
|
|
?>
|
|
|
|
|
|
|
|
<?php /* Adding the AJAX nonce this way allows caching plugins to update it dynamically. */ ?>
|
|
|
|
<input id="fictioneer-nonce" name="fictioneer_nonce" type="hidden" value="<?php echo wp_create_nonce( 'fictioneer_nonce' ); ?>">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
// Lightbox container
|
|
|
|
if ( get_option( 'fictioneer_enable_lightbox' ) ) {
|
2023-02-21 09:45:18 +01:00
|
|
|
echo '<div id="fictioneer-lightbox" class="lightbox"><button type="button" class="lightbox__close" aria-label="' . esc_attr__( 'Close lightbox', 'fictioneer' ) . '">' . fictioneer_get_icon( 'fa-xmark' ) . '</button><i class="fa-solid fa-spinner fa-spin loader" style="--fa-animation-duration: .8s;"></i><div class="lightbox__content target"></div></div>';
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
|
2023-08-03 19:56:25 +02:00
|
|
|
// Fictioneer footer hook
|
|
|
|
do_action( 'fictioneer_footer', $args );
|
|
|
|
|
2023-06-08 21:30:25 +02:00
|
|
|
// WordPress footer hook (includes modals)
|
2023-01-21 01:31:34 +01:00
|
|
|
wp_footer();
|
|
|
|
?>
|
|
|
|
|
|
|
|
<injectjs /> <!-- Autoptimize insert position -->
|
|
|
|
</body>
|
|
|
|
</html>
|