Ticket #21606: taxonomy.php.patch
| File taxonomy.php.patch, 1.2 KB (added by barrykooij, 10 months ago) |
|---|
-
wp-includes/taxonomy.php
1461 1461 * @param int|string $term The term to check 1462 1462 * @param string $taxonomy The taxonomy name to use 1463 1463 * @param int $parent ID of parent term under which to confine the exists search. 1464 * @return mixed Returns 0if the term does not exist. Returns the term ID if no taxonomy is specified1464 * @return mixed Returns null if the term does not exist. Returns the term ID if no taxonomy is specified 1465 1465 * and the term ID exists. Returns an array of the term ID and the taxonomy if the pairing exists. 1466 1466 */ 1467 1467 function term_exists($term, $taxonomy = '', $parent = 0) { … … 1472 1472 1473 1473 if ( is_int($term) ) { 1474 1474 if ( 0 == $term ) 1475 return 0;1475 return null; 1476 1476 $where = 't.term_id = %d'; 1477 1477 if ( !empty($taxonomy) ) 1478 1478 return $wpdb->get_row( $wpdb->prepare( $tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy ), ARRAY_A ); … … 1483 1483 $term = trim( stripslashes( $term ) ); 1484 1484 1485 1485 if ( '' === $slug = sanitize_title($term) ) 1486 return 0;1486 return null; 1487 1487 1488 1488 $where = 't.slug = %s'; 1489 1489 $else_where = 't.name = %s';