Changeset 30205 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 11/03/2014 02:24:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r30184 r30205 4263 4263 4264 4264 foreach ( $object_terms as $object_term ) { 4265 if ( $ints && in_array( $object_term->term_id, $ints ) ) return true; // If int, check against term_id 4265 // If term is an int, check against term_ids only. 4266 if ( $ints && in_array( $object_term->term_id, $ints ) ) { 4267 return true; 4268 } 4269 4266 4270 if ( $strs ) { 4267 if ( in_array( $object_term->term_id, $strs ) ) return true; 4268 if ( in_array( $object_term->name, $strs ) ) return true; 4269 if ( in_array( $object_term->slug, $strs ) ) return true; 4271 // Only check numeric strings against term_id, to avoid false matches due to type juggling. 4272 $numeric_strs = array_map( 'intval', array_filter( $strs, 'is_numeric' ) ); 4273 if ( in_array( $object_term->term_id, $numeric_strs, true ) ) { 4274 return true; 4275 } 4276 4277 if ( in_array( $object_term->name, $strs ) ) return true; 4278 if ( in_array( $object_term->slug, $strs ) ) return true; 4270 4279 } 4271 4280 }
Note: See TracChangeset
for help on using the changeset viewer.