WordPress.org

Make WordPress Core

Changeset 51520


Ignore:
Timestamp:
07/31/2021 09:49:35 AM (4 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r50804 r51520  
    17261726                        <input type="hidden" name="<?php echo ( 'category' === $taxonomy->name ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
    17271727                        <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist">
    1728                             <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
     1728                            <?php wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name ) ); ?>
    17291729                        </ul>
    17301730
Note: See TracChangeset for help on using the changeset viewer.