type mismatch between is_term and get_term_by
|Reported by:||tellyworth||Owned by:|
get_term_by() and similar functions return a row that includes the term_id as a numeric string. is_term() requires that a term_id be passed in as an int; a numeric string will fail.
I don't know what the solution is but this seems like a likely cause of bugs. Code that looks like it ought to work fails:
$term_id = get_term_by('name', $term, $taxonomy); if ( is_term($term_id) ) ... // fails because is_term returns false
test_is_term_type() in http://svn.automattic.com/wordpress-tests/wp-testcase/test_includes_taxonomy.php reproduces the problem.
There are other related type inconsistencies in taxonomy.php also - for example, is_term() returns a 0, NULL, term ID, WP_Error object or row object depending on the context and circumstances, which makes handling the return result difficult. Mostly due I think to the functions being overloaded to magically handle both term ids and names.