Restore unified paid download model
This commit is contained in:
+20
@@ -94,6 +94,14 @@ while (have_posts()) :
|
||||
$post_episode_count = max(0, (int) get_post_meta($post_id, '_aksrt_featured_video_episode', true));
|
||||
$post_slide_images = array_values(array_filter((array) ($single_settings['slide_images'] ?? [])));
|
||||
$author_card_html = '';
|
||||
$is_resource_compat_post = function_exists('aksrt_is_resource_post') && aksrt_is_resource_post($post_id);
|
||||
$has_download_capability = function_exists('aksrt_is_downloadable_content') && aksrt_is_downloadable_content($post_id);
|
||||
$paid_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_paid_content_settings() : [];
|
||||
$paid_display_settings = is_array($paid_settings['display'] ?? null) ? $paid_settings['display'] : [];
|
||||
$paid_box_position = (string) ($paid_display_settings['box_position'] ?? 'top');
|
||||
if (!in_array($paid_box_position, ['box_top', 'top', 'bottom', 'box_bottom'], true)) {
|
||||
$paid_box_position = 'top';
|
||||
}
|
||||
if (class_exists('AKSRT_Docs_Presenter')) {
|
||||
$docs_presenter = AKSRT_Docs_Presenter::get_instance();
|
||||
if ($docs_presenter->is_docs_page($post_id)) {
|
||||
@@ -290,6 +298,12 @@ while (have_posts()) :
|
||||
|
||||
<?php do_action('aksrt_single_content_before', $post); ?>
|
||||
|
||||
<?php if ($has_download_capability && in_array($paid_box_position, ['box_top', 'top'], true)) : ?>
|
||||
<div class="aksrt-single-download-box aksrt-single-download-box--before<?php echo $is_resource_compat_post ? ' is-legacy-resource' : ''; ?>">
|
||||
<?php get_template_part('templates/parts/resource-download-box'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (is_active_sidebar('single_top_content')) : ?>
|
||||
<div class="aksrt-single-widget-area aksrt-single-widget-area--top">
|
||||
<?php dynamic_sidebar('single_top_content'); ?>
|
||||
@@ -317,6 +331,12 @@ while (have_posts()) :
|
||||
<div class="post_after_content theme-box box-body"><?php echo wp_kses_post($post_after_content); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($has_download_capability && in_array($paid_box_position, ['bottom', 'box_bottom'], true)) : ?>
|
||||
<div class="aksrt-single-download-box aksrt-single-download-box--after<?php echo $is_resource_compat_post ? ' is-legacy-resource' : ''; ?>">
|
||||
<?php get_template_part('templates/parts/resource-download-box'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($author_card_html !== '') : ?>
|
||||
<?php echo $author_card_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user