--- a/wp/wp-admin/includes/class-walker-category-checklist.php Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-admin/includes/class-walker-category-checklist.php Fri Sep 05 18:52:52 2025 +0200
@@ -107,11 +107,13 @@
/** This filter is documented in wp-includes/category-template.php */
esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
} else {
- $is_selected = in_array( $category->term_id, $args['selected_cats'], true );
- $is_disabled = ! empty( $args['disabled'] );
+ $is_selected = in_array( $category->term_id, $args['selected_cats'], true );
+ $is_disabled = ! empty( $args['disabled'] );
+ $li_element_id = wp_unique_prefixed_id( "in-{$taxonomy}-{$category->term_id}-" );
+ $checkbox_element_id = wp_unique_prefixed_id( "in-{$taxonomy}-{$category->term_id}-" );
- $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
- '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
+ $output .= "\n<li id='" . esc_attr( $li_element_id ) . "'$class>" .
+ '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="' . esc_attr( $checkbox_element_id ) . '"' .
checked( $is_selected, true, false ) .
disabled( $is_disabled, true, false ) . ' /> ' .
/** This filter is documented in wp-includes/category-template.php */