Changeset 10813
- Timestamp:
- 03/18/2009 09:06:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r10810 r10813 1060 1060 * The $args 'default' will only override the terms found, if there is only one 1061 1061 * term found. Any other and the found terms are used. 1062 * 1062 * 1063 * The $args 'force_default' will force the term supplied as default to be 1064 * assigned even if the object was not going to be termless 1063 1065 * @package WordPress 1064 1066 * @subpackage Taxonomy … … 1111 1113 foreach ( (array) $objects as $object ) { 1112 1114 $terms = wp_get_object_terms($object, $taxonomy, 'fields=ids'); 1113 if ( 1 == count($terms) && isset($default) ) 1115 if ( 1 == count($terms) && isset($default) ) { 1114 1116 $terms = array($default); 1115 else1117 } else { 1116 1118 $terms = array_diff($terms, array($term)); 1119 if (isset($default) && isset($force_default) && $force_default) 1120 $terms = array_merge($terms, array($default)); 1121 } 1117 1122 $terms = array_map('intval', $terms); 1118 1123 wp_set_object_terms($object, $terms, $taxonomy);
Note: See TracChangeset
for help on using the changeset viewer.