You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
How is this possible? My understanding is get_term_by will return null for a term_id that doesn't belong to that taxonomy, and no shared terms should now have stopped that being unexpected.
My understanding is get_term_by will return null for a term_id that doesn't belong to that taxonomy, and no shared terms should now have stopped that being unexpected.
Nope:
} elseif ( 'term_taxonomy_id' == $field ) {
$value = (int) $value;
$_field = 'tt.term_taxonomy_id';
// No `taxonomy` clause when searching by 'term_taxonomy_id'.
$tax_clause = '';
} else {
$term = get_term( (int) $value, $taxonomy, $output, $filter );
if ( is_wp_error( $term ) || is_null( $term ) ) {
$term = false;
}
return $term;
}
$term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE $_field = %s $tax_clause LIMIT 1", $value ) );
if ( ! $term )
return false;
// In the case of 'term_taxonomy_id', override the provided `$taxonomy` with whatever we find in the db.
if ( 'term_taxonomy_id' === $field ) {
$taxonomy = $term->taxonomy;
}
If term_taxonomy_id is provided, then get_term_by() ignores the provided taxonomy
The reason will be displayed to describe this comment to others. Learn more.
How is this possible? My understanding is get_term_by will return null for a term_id that doesn't belong to that taxonomy, and no shared terms should now have stopped that being unexpected.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clients should only be able to request categories from the category route, and tags from the tag route
Fixes #1763