Make WordPress Core


Ignore:
Timestamp:
04/11/2007 06:04:49 PM (19 years ago)
Author:
ryan
Message:

Allow passing an empty tag set to wp_set_post_tags() so all tags can be removed from a post. see #3723

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r5231 r5243  
    800800        // prevent warnings for unintialized variables
    801801        $tag_ids = array();
    802        
     802
     803        if ( empty($tags) )
     804                $tags = array();
    803805        $tags = (is_array($tags)) ? $tags : explode( ',', $tags );
    804806       
     
    811813                $tag_ids[] = $tag_id;
    812814        }
    813        
    814         if ( empty($tag_ids) )
     815
     816        if ( empty($tag_ids) && ( !empty($tags) || $append ) )
    815817                return false;
    816818       
Note: See TracChangeset for help on using the changeset viewer.