Taxonomy: Pass correct default value for $post_id to wp_terms_checklist() in the posts list table.

This matches the documented type of the `$post_id` argument and is consistent with other instances of `wp_terms_checklist()` calls.

Per the function documentation, the default value is integer `0`, not `null`.

Follow-up to [13535].

Props tareiking, donmhico, jrf.
Fixes #43639.

git-svn-id: https://develop.svn.wordpress.org/trunk@51520 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-07-31 09:49:35 +00:00
parent 8f3d2b46ad
commit 812d110c5d

View File

@ -1725,7 +1725,7 @@ class WP_Posts_List_Table extends WP_List_Table {
<span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
<input type="hidden" name="<?php echo ( 'category' === $taxonomy->name ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
<ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist">
<?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
<?php wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name ) ); ?>
</ul>
<?php endforeach; // $hierarchical_taxonomies as $taxonomy ?>