Make WordPress Core

Ticket #36379: 36379.diff

File 36379.diff, 1.3 KB (added by dlh, 9 years ago)
  • src/wp-admin/includes/class-walker-category-checklist.php

     
    9898                                ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' .
    9999                                esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
    100100                } else {
     101                        $checked = checked( in_array( $category->term_id, $args['selected_cats'] ), true, false );
     102
    101103                        /** This filter is documented in wp-includes/category-template.php */
    102104                        $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
    103105                                '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' .
    104                                 checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) .
     106                                $checked .
    105107                                disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
    106108                                esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>';
     109
     110                        if ( ! empty( $args['disabled'] ) && $checked ) {
     111                                $output .= sprintf(
     112                                        '<input value="%d" type="hidden" name="%s[]" />',
     113                                        $category->term_id,
     114                                        esc_attr( $name )
     115                                );
     116                        }
    107117                }
    108118        }
    109119