fix(submit): keep sidebar visible on front submit page

This commit is contained in:
2026-09-05 21:50:40 +08:00
parent 49ffdc6ab2
commit 51dd38163d
7 changed files with 20 additions and 654 deletions
+1 -15
View File
@@ -5,16 +5,14 @@
* @param WP_Term[] $terms
* @param int[] $checked
* @param string $name
* @param string $taxonomy
* @param int $parent
* @param int $depth
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_submit_render_term_checks')) :
function aksrt_submit_render_term_checks(array $terms, array $checked, string $name, string $taxonomy = 'category', int $parent = 0, int $depth = 0): void {
function aksrt_submit_render_term_checks(array $terms, array $checked, string $name, int $parent = 0, int $depth = 0): void {
$children_map = [];
$roots = [];
foreach ($terms as $term) {
if (!$term instanceof WP_Term) {
continue;
@@ -55,17 +53,5 @@ if (!function_exists('aksrt_submit_render_term_checks')) :
}
$render($parent, $depth);
// Orphans (included children without parent in set).
$seen_parents = array_keys($children_map);
foreach ($terms as $term) {
if (!$term instanceof WP_Term) {
continue;
}
$pid = (int) $term->parent;
if ($pid > 0 && !isset($children_map[$pid]) && !isset($children_map[0])) {
// already handled if parent missing — skip double.
}
}
}
endif;