Changeset 14426
- Timestamp:
- 05/03/2010 11:35:22 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/meta-boxes.php
r14404 r14426 308 308 309 309 <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 ?> 310 314 <ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy?> categorychecklist form-no-clear"> 311 315 <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?> -
trunk/wp-includes/post.php
r14404 r14426 2071 2071 if ( empty($post_type) ) 2072 2072 $post_type = 'post'; 2073 2074 if ( !empty($post_category) ) 2075 $post_category = array_filter($post_category); // Filter out empty terms 2073 2076 2074 2077 // Make sure we set a valid category. … … 2226 2229 wp_set_post_categories( $post_ID, $post_category ); 2227 2230 // old-style tags_input 2228 if ( isset( $tags_input ) ) 2231 if ( isset( $tags_input ) ) { 2232 $tags_input = array_filter($tags_input); 2229 2233 wp_set_post_tags( $post_ID, $tags_input ); 2230 // new-style support for all tag-like taxonomies 2234 } 2235 // new-style support for all custom taxonomies 2231 2236 if ( !empty($tax_input) ) { 2232 2237 foreach ( $tax_input as $taxonomy => $tags ) { 2233 2238 $taxonomy_obj = get_taxonomy($taxonomy); 2239 if ( is_array($tags) ) // array = hierarchical, string = non-hierarchical. 2240 $tags = array_filter($tags); 2234 2241 if ( current_user_can($taxonomy_obj->assign_cap) ) 2235 2242 wp_set_post_terms( $post_ID, $tags, $taxonomy ); … … 2785 2792 $page_paths = explode('/', $page_paths); 2786 2793 $full_path = ''; 2787 foreach ( (array) $page_paths as $pathdir)2788 $full_path .= ( $pathdir!=''?'/':'') . sanitize_title($pathdir);2794 foreach ( (array) $page_paths as $pathdir ) 2795 $full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir); 2789 2796 2790 2797 $pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = %s AND (post_type = %s OR post_type = 'attachment')", $leaf_path, $post_type )); … … 3669 3676 */ 3670 3677 function wp_check_for_changed_slugs($post_id) { 3671 if ( !isset($_POST['wp-old-slug']) || !strlen($_POST['wp-old-slug']) )3678 if ( empty($_POST['wp-old-slug']) ) 3672 3679 return $post_id; 3673 3680
Note: See TracChangeset
for help on using the changeset viewer.