Make WordPress Core


Ignore:
Timestamp:
05/03/2010 11:35:22 PM (16 years ago)
Author:
dd32
Message:

Handle $_POST containing an empty term array, Fixes saving of deselecting all hierarchical terms. Fixes #10122

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r14404 r14426  
    308308
    309309        <div id="<?php echo $taxonomy; ?>-all" class="tabs-panel">
     310            <?php
     311            $name = ( $taxonomy == 'category' ) ? 'post_category' : 'tax_input[' . $taxonomy . ']';
     312            echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
     313            ?>
    310314            <ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy?> categorychecklist form-no-clear">
    311315                <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?>
Note: See TracChangeset for help on using the changeset viewer.