fix(admin): replicate reference advanced-filter settings page 1:1

- Rewrite post_list/filter schema (PHP + JS) with the reference theme's
  field set, order, defaults and dependencies; topics fields excluded
  (no topics taxonomy), AKSRT private filter_* toggles dropped
- Support dynamic checkbox options in AksField (options as formData key)
  so cat_custom_filter.custom_filters lists the custom_filter dimensions
- Map PostDisplay filter settings to the new keys without legacy fallback;
  cat_custom_filter now carries lists/dropdown fieldsets and array filters
- Wire the archive chain to reference semantics: cat_custom_filter
  overrides per-category filter projects, custom_filter_show gates the
  default display, dimension chip groups render on category/tag archives
- Filter archive queries (main query + AJAX endpoint) by _aksrt_cf_{key}
  meta with exact-quoted LIKE matching
- Add advanced-filter settings reference contract test
This commit is contained in:
kate522 committed 2026-09-24 15:39:25 +08:00
1 parent 4d6b2c6045
commit a8060fa71d
16 files changed
+635 -154

No files matched your search

+8 -8
View File
@@ -666,9 +666,9 @@ class Settings {
/**
* Post-list filter toolbar settings.
* Post-list advanced filter settings (reference parity).
*
* @return array{enabled:bool,categories:bool,tags:bool,sort:bool}
* @return array{custom_filter_show:array,custom_filter:array,cat_custom_filter:array}
*/
public static function get_post_filter_settings(): array {
return PostDisplay::get_post_filter_settings();
@@ -677,14 +677,14 @@ class Settings {
/**
* Get custom filter definitions for a specific category.
* Finds the matching cat_custom_filter binding, falls back to global custom_filter.
* Archive custom filter config (cat_custom_filter override + custom_filter_show gate).
*
* @param int $cat_id Category term ID.
* @return array{dimensions: array, show_cat: bool, show_tag: bool, show_orderby: bool}
* @param int $term_id Category term ID.
* @param string $page cat|tag.
* @return array{custom_enabled:bool,custom_filters:mixed,overrides:array<string,mixed>}
*/
public static function get_filter_config_for_category(int $cat_id): array {
return PostDisplay::get_filter_config_for_category($cat_id);
public static function get_archive_custom_filter_config(int $term_id, string $page): array {
return PostDisplay::get_archive_custom_filter_config($term_id, $page);
}