Changeset 47550 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 04/05/2020 03:00:44 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r47219 r47550 621 621 } 622 622 623 if ( ! in_array( $object_type, $wp_taxonomies[ $taxonomy ]->object_type ) ) {623 if ( ! in_array( $object_type, $wp_taxonomies[ $taxonomy ]->object_type, true ) ) { 624 624 $wp_taxonomies[ $taxonomy ]->object_type[] = $object_type; 625 625 } … … 1527 1527 function sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) { 1528 1528 $int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' ); 1529 if ( in_array( $field, $int_fields ) ) {1529 if ( in_array( $field, $int_fields, true ) ) { 1530 1530 $value = (int) $value; 1531 1531 if ( $value < 0 ) { … … 2237 2237 2238 2238 $existing_term = null; 2239 if ( ( ! $slug_provided || $name_match->slug === $slug ) && in_array( $name, wp_list_pluck( $siblings, 'name' ) ) ) { 2239 $sibling_names = wp_list_pluck( $siblings, 'name' ); 2240 $sibling_slugs = wp_list_pluck( $siblings, 'slug' ); 2241 2242 if ( ( ! $slug_provided || $name_match->slug === $slug ) && in_array( $name, $sibling_names, true ) ) { 2240 2243 $existing_term = $name_match; 2241 } elseif ( $slug_match && in_array( $slug, wp_list_pluck( $siblings, 'slug' )) ) {2244 } elseif ( $slug_match && in_array( $slug, $sibling_slugs, true ) ) { 2242 2245 $existing_term = $slug_match; 2243 2246 } … … 3701 3704 $object_types = array_unique( $object_types ); 3702 3705 3703 $check_attachments = array_search( 'attachment', $object_types );3706 $check_attachments = array_search( 'attachment', $object_types, true ); 3704 3707 if ( false !== $check_attachments ) { 3705 3708 unset( $object_types[ $check_attachments ] ); … … 4446 4449 foreach ( $object_terms as $object_term ) { 4447 4450 // If term is an int, check against term_ids only. 4448 if ( $ints && in_array( $object_term->term_id, $ints ) ) {4451 if ( $ints && in_array( $object_term->term_id, $ints, true ) ) { 4449 4452 return true; 4450 4453 } … … 4457 4460 } 4458 4461 4459 if ( in_array( $object_term->name, $strs ) ) {4462 if ( in_array( $object_term->name, $strs, true ) ) { 4460 4463 return true; 4461 4464 } 4462 if ( in_array( $object_term->slug, $strs ) ) {4465 if ( in_array( $object_term->slug, $strs, true ) ) { 4463 4466 return true; 4464 4467 } … … 4483 4486 return false; 4484 4487 } 4485 return in_array( $taxonomy, $taxonomies );4488 return in_array( $taxonomy, $taxonomies, true ); 4486 4489 } 4487 4490
Note: See TracChangeset
for help on using the changeset viewer.