feat(pay): alone download page, free-login gate, list pay badges
This commit is contained in:
1 parent
0ad41715e2
commit
5acf302e53
8 files changed
+448
-186
No files matched your search
@@ -328,6 +328,45 @@ if (!function_exists('aksrt_get_download_cost')) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the Zibll-style single-post download page (page template + ?post=ID).
|
||||
*/
|
||||
if (!function_exists('aksrt_get_single_download_page_url')) {
|
||||
function aksrt_get_single_download_page_url($post = null): string {
|
||||
$p = get_post($post);
|
||||
if (!($p instanceof WP_Post)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$page_url = '';
|
||||
if (function_exists('aksrt_find_template_page')) {
|
||||
$page = aksrt_find_template_page('templates/pages/page-download-file.php');
|
||||
if ($page instanceof WP_Post) {
|
||||
$page_url = get_permalink($page);
|
||||
}
|
||||
}
|
||||
if ($page_url === '') {
|
||||
// Fallback: look for any page using the template via slug convention.
|
||||
$page_url = home_url('/download-file/');
|
||||
}
|
||||
|
||||
return add_query_arg('post', (int) $p->ID, $page_url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether independent download page mode is enabled (Zibll down_alone_page).
|
||||
*/
|
||||
if (!function_exists('aksrt_is_download_alone_page_enabled')) {
|
||||
function aksrt_is_download_alone_page_enabled(): bool {
|
||||
if (!class_exists('AKSRT_Settings')) {
|
||||
return false;
|
||||
}
|
||||
$paid = AKSRT_Settings::get_paid_content_settings();
|
||||
return !empty($paid['down_alone_page']) || !empty($paid['download']['alone_page']);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// 价格显示
|
||||
// ============================================================
|
||||
|
||||
Reference in new issue
Block a user