true, 'allowed_topic_ids' => [1]]; $child = ['allow_topics' => true, 'allowed_topic_ids' => [2]]; $disabled = ['allow_topics' => false, 'allowed_topic_ids' => []]; $tree = static fn(array $settings): array => array_map( static fn(array $node): array => ['id' => $node['term']->term_id, 'depth' => $node['depth']], \Jio\Core\SubmitTopics::tree($settings) ); ob_start(); jio_submit_render_term_checks([new WP_Term(2, 1, 'Child')], [], 'topics'); $orphan_html = ob_get_clean(); echo json_encode([ 'root_tree' => $tree($root), 'child_tree' => $tree($child), 'disabled_tree' => $tree($disabled), 'filtered' => \Jio\Core\SubmitTopics::filter_ids([2, 4, 999, 2], $child), 'disabled_filtered' => \Jio\Core\SubmitTopics::filter_ids([2], $disabled), 'orphan_html' => $orphan_html, ], JSON_THROW_ON_ERROR);