Ticket #16101: 16101.diff
File 16101.diff, 1.6 KB (added by , 15 months ago) 


taxonomy.php
1426 1426 $select = "SELECT term_id FROM $wpdb>terms as t WHERE "; 1427 1427 $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb>terms AS t INNER JOIN $wpdb>term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; 1428 1428 1429 if ( is_int( $term ) ) {1429 if ( ctype_digit( $term ) ) { 1430 1430 if ( 0 === $term ) { 1431 1431 return 0; 1432 1432 } … … 2217 2217 return $term; 2218 2218 } 2219 2219 2220 if ( is_int( $term ) && 0 === $term ) {2220 if ( ctype_digit( $term ) && 0 === $term ) { 2221 2221 return new WP_Error( 'invalid_term_id', __( 'Invalid term ID.' ) ); 2222 2222 } 2223 2223 … … 2592 2592 2593 2593 if ( ! $term_info ) { 2594 2594 // Skip if a nonexistent term ID is passed. 2595 if ( is_int( $term ) ) {2595 if ( ctype_digit( $term ) ) { 2596 2596 continue; 2597 2597 } 2598 2598 … … 2762 2762 $term_info = term_exists( $term, $taxonomy ); 2763 2763 if ( ! $term_info ) { 2764 2764 // Skip if a nonexistent term ID is passed. 2765 if ( is_int( $term ) ) {2765 if ( ctype_digit( $term ) ) { 2766 2766 continue; 2767 2767 } 2768 2768 } … … 4344 4344 global $wp_rewrite; 4345 4345 4346 4346 if ( ! is_object( $term ) ) { 4347 if ( is_int( $term ) ) {4347 if ( ctype_digit( $term ) ) { 4348 4348 $term = get_term( $term, $taxonomy ); 4349 4349 } else { 4350 4350 $term = get_term_by( 'slug', $term, $taxonomy ); … … 4599 4599 4600 4600 $terms = (array) $terms; 4601 4601 4602 $ints = array_filter( $terms, ' is_int' );4602 $ints = array_filter( $terms, 'ctype_digit' ); 4603 4603 if ( $ints ) { 4604 4604 $strs = array_diff( $terms, $ints ); 4605 4605 } else {