WordPress.org

Make WordPress Core

Ticket #12318: 12318.diff

File 12318.diff, 533 bytes (added by sivel, 5 years ago)

Don't check if $tags_input is empty before running wp_set_post_tags, allow for removing all tags.

  • wp-includes/post.php

     
    21792179 
    21802180        wp_set_post_categories( $post_ID, $post_category ); 
    21812181        // old-style tags_input 
    2182         if ( !empty($tags_input) ) 
    2183                 wp_set_post_tags( $post_ID, $tags_input ); 
     2182        wp_set_post_tags( $post_ID, $tags_input ); 
    21842183        // new-style support for all tag-like taxonomies 
    21852184        if ( !empty($tax_input) ) { 
    21862185                foreach ( $tax_input as $taxonomy => $tags ) {