fix(admin): replicate reference comment settings page 1:1
- Rewrite post_list/comment schema (PHP + JS) with the reference theme's field set, order, defaults and dependencies; smilie, comment location and quick-reply fields excluded - Map PostDisplay::get_comment_display_settings() to the new keys without legacy fallback: close_comments, comment_paginate_type (ajax_lists), user_edit_comment master switch, WP comment_order for sorting - Wire comment_box_hide visibility gate (signin / vip / vip_2 / auth) - Drop dead comment settings (order/per_page/depth/avatar/hot threshold/ empty text/city), the dead post_close_comments field, and city readers now fully owned by the IP-geo extension - Add comment settings reference contract test
This commit is contained in:
1 parent
264f2c51b2
commit
c331b2aeef
11 files changed
+382
-200
No files matched your search
@@ -3,7 +3,7 @@
|
||||
* Comment city / IP geo helpers.
|
||||
*
|
||||
* Meta: aksrt_comment_addr {country,province,city}
|
||||
* Gates: ip_geo_enabled + ip_geo_display has comment + comment_city_s
|
||||
* Gates: ip_geo_enabled + ip_geo_display has comment(扩展&增强 / IP归属地统一控制)
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
@@ -12,27 +12,14 @@ defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_comment_city_enabled')) :
|
||||
function aksrt_comment_city_enabled(): bool {
|
||||
if (function_exists('aksrt_ip_geo_display_enabled') && !aksrt_ip_geo_display_enabled('comment')) {
|
||||
return false;
|
||||
}
|
||||
if (!class_exists('\AKSRT\Settings\Settings')) {
|
||||
return false;
|
||||
}
|
||||
$s = \AKSRT\Settings\Settings::get_comment_display_settings();
|
||||
return !empty($s['city_s']);
|
||||
// 评论区位置显示的开关与精度统一由「扩展&增强 / IP归属地」配置提供。
|
||||
return function_exists('aksrt_ip_geo_display_enabled') && aksrt_ip_geo_display_enabled('comment');
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_comment_city_type')) :
|
||||
function aksrt_comment_city_type(): string {
|
||||
if (!class_exists('\AKSRT\Settings\Settings')) {
|
||||
return function_exists('aksrt_ip_geo_format_key') ? aksrt_ip_geo_format_key() : 'province_city';
|
||||
}
|
||||
$s = \AKSRT\Settings\Settings::get_comment_display_settings();
|
||||
$type = sanitize_key((string) ($s['city_type'] ?? 'province_city'));
|
||||
return in_array($type, ['province_city', 'province', 'country_province'], true)
|
||||
? $type
|
||||
: 'province_city';
|
||||
return function_exists('aksrt_ip_geo_format_key') ? aksrt_ip_geo_format_key() : 'province_city';
|
||||
}
|
||||
endif;
|
||||
|
||||
|
||||
Reference in new issue
Block a user