feat: remove forum feature (Phase 1)
This commit is contained in:
1 parent
f3e4cdd9cf
commit
2bbd7c01a3
173 files changed
+51
-27360
No files matched your search
@@ -735,24 +735,6 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js';
|
||||
}
|
||||
}
|
||||
|
||||
// Forum pages (home / plate / board tax / tag / topic / compose / plate-cat)
|
||||
$is_forum_surface = is_page_template('templates/pages/page-forums.php')
|
||||
|| is_page_template('templates/forum/forum-compose.php')
|
||||
|| is_tax('aksrt_forum_board')
|
||||
|| is_tax('aksrt_forum_tag')
|
||||
|| is_tax('aksrt_plate_cat')
|
||||
|| is_singular('aksrt_forum_topic')
|
||||
|| is_singular('aksrt_forum_plate');
|
||||
|
||||
if ($is_forum_surface) {
|
||||
wp_enqueue_style(
|
||||
'aksrt-forum',
|
||||
$base_uri . '/assets/css/frontend/forum.css',
|
||||
['aksrt-tokens'],
|
||||
$version
|
||||
);
|
||||
}
|
||||
|
||||
// Product archive pages (category / tag)
|
||||
if (is_tax('aksrt_product_cat') || is_tax('aksrt_product_tag')) {
|
||||
wp_enqueue_style(
|
||||
@@ -826,51 +808,6 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js';
|
||||
);
|
||||
}
|
||||
|
||||
// Forum edit page
|
||||
if (is_singular('aksrt_forum_topic') && isset($_GET['edit']) && $_GET['edit'] === '1') {
|
||||
$forum_edit_js = get_template_directory() . '/assets/js/forum-edit.js';
|
||||
if (file_exists($forum_edit_js)) {
|
||||
wp_enqueue_script(
|
||||
'aksrt-forum-edit',
|
||||
$base_uri . '/assets/js/forum-edit.js',
|
||||
['aksrt-script'],
|
||||
(string) filemtime($forum_edit_js),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_forum_surface) {
|
||||
$forum_governance_js = get_template_directory() . '/assets/js/forum-governance.js';
|
||||
if (file_exists($forum_governance_js)) {
|
||||
wp_enqueue_script(
|
||||
'aksrt-forum-governance',
|
||||
$base_uri . '/assets/js/forum-governance.js',
|
||||
['aksrt-script'],
|
||||
(string) filemtime($forum_governance_js),
|
||||
true
|
||||
);
|
||||
wp_localize_script('aksrt-forum-governance', 'aksrtForumGovernance', [
|
||||
'ajaxUrl' => admin_url('admin-ajax.php'),
|
||||
'restUrl' => esc_url_raw(rest_url()),
|
||||
'restNonce' => wp_create_nonce('wp_rest'),
|
||||
'publicNonce' => wp_create_nonce('aksrt_public_nonce'),
|
||||
'i18n' => [
|
||||
'empty' => __('内容空空如也', 'aksrt'),
|
||||
'loadMore' => __('加载更多', 'aksrt'),
|
||||
'loading' => __('加载中…', 'aksrt'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
// §7.4: enqueue media on compose and edit pages
|
||||
$is_compose = is_page_template('templates/forum/forum-compose.php');
|
||||
$is_edit = is_singular('aksrt_forum_topic') && isset($_GET['edit']) && $_GET['edit'] === '1';
|
||||
if ($is_compose || $is_edit) {
|
||||
wp_enqueue_media();
|
||||
}
|
||||
}
|
||||
|
||||
// 商品编辑页共用 page-edit.js
|
||||
if (is_page_template('templates/pages/page-product-edit.php')) {
|
||||
$page_edit_js = get_template_directory() . '/assets/js/page-edit.js';
|
||||
@@ -901,7 +838,7 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js';
|
||||
}
|
||||
|
||||
// 单篇文章 — poster-share.js(海报分享按钮)
|
||||
if (is_singular('post') || is_singular('aksrt_forum_topic')) {
|
||||
if (is_singular('post')) {
|
||||
$poster_js = get_template_directory() . '/assets/js/poster-share.js';
|
||||
if (file_exists($poster_js)) {
|
||||
wp_enqueue_script(
|
||||
@@ -977,20 +914,8 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js';
|
||||
$enqueue_module('resource-archive');
|
||||
}
|
||||
|
||||
// 付费论坛主题:多网关收银台(与内容共用 cms-download.js)
|
||||
$is_pay_forum_topic = is_singular('aksrt_forum_topic')
|
||||
&& sanitize_key((string) get_post_meta(get_queried_object_id(), '_aksrt_visibility', true)) === 'pay';
|
||||
|
||||
// 版块现金付费关注:多网关收银台
|
||||
$is_pay_forum_plate = false;
|
||||
if (is_singular('aksrt_forum_plate')) {
|
||||
$plate_qid = get_queried_object_id();
|
||||
$is_pay_forum_plate = (int) get_post_meta($plate_qid, '_aksrt_follow_pay', true) === 1
|
||||
&& sanitize_key((string) (get_post_meta($plate_qid, '_aksrt_follow_pay_modo', true) ?: 'money')) === 'money';
|
||||
}
|
||||
|
||||
// 单篇资源 / 付费内容 / 独立下载页 / 付费主题 / 付费关注版块:下载 + 收银台脚本
|
||||
if ($is_single_resource || $is_paid_content_single || $is_download_file_page || $is_pay_forum_topic || $is_pay_forum_plate) {
|
||||
// 单篇资源 / 付费内容 / 独立下载页:下载 + 收银台脚本
|
||||
if ($is_single_resource || $is_paid_content_single || $is_download_file_page) {
|
||||
$cms_download_js_path = get_template_directory() . '/assets/js/cms-download.js';
|
||||
wp_enqueue_script(
|
||||
'aksrt-cms-download',
|
||||
|
||||
Reference in new issue
Block a user