How about using the get_term
function? If you look at the code the sql it uses is as follows:
$_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 tt.taxonomy = %s AND t.term_id = %d LIMIT 1", $taxonomy, $term) );
which should be exactly what you need!
Related Posts:
- Using pre_get_posts to rewrite search query to display posts from multiple taxonomies
- Exclude Specific Term from Search
- WordPress database error: [Not unique table/alias: ‘wp_postmeta’]
- WordPress Search – display taxonomy terms in results
- Sort posts by number of matched terms
- How to add custom taxonomy to search
- Taxonomy.php issue with search and filters
- Extending wordpress search to include excerpts and taxonomies?
- How to filter WordPress search, excluding post in some custom taxonomies?
- how to search in custom fields & custom taxonomy for custom search
- Search by type posts and taxonomy
- Creating a custom search form
- How to implement custom search with input fields?
- How do I keep the page I’m on within the URL when running a search on a taxonomy?
- Add multiple taxonomy filters to edit.php that support search
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- Custom Taxonomy Not Working When added to WordPress Search
- Search Tool only refreshes Page without showing results
- WordPress thinks my custom taxonomy pages are search pages #seo
- Removing “s” from search with custom parameters
- Passing form inputs into multi-taxonomy query
- Custom URLs in Custom Search Results
- Search Query for Multiple Terms In Same Taxonomy
- Use an HTML Element To Filter Taxonomies In WP Search
- Why isn’t the ‘no results’ being shown when a query returns no results?
- Clean Custom URL for Serach + Custom Taxonomy
- Advanced search redirecting to another page then filter further
- Search only custom taxonomies
- WordPress autocomplete search with taxonomies
- Geographic search with taxonomy structure [duplicate]
- search using multiple taxonomies and keyword
- Taxonomy or Custom Field
- Multiple Drop-Down custom taxonomies search
- Filter with two id of the same value CPT UI(taxanomies)
- Amend taxonomy to search in wordpress admin
- Include get_term_link inside search
- Product custom taxonomy is not found when space in name
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- Search custom taxonomy via query-string?
- How to exclude woocommerece product category in search results?
- WordPress custom taxonomies new/edit post autocomplete
- Post not showing in my custom advanced search
- Include attachments with a custom taxonomy in search
- Custom taxonomy displayed in search results
- How to perform a search inside a specific taxonomy category
- Custom Taxonomy, shows empty value (home page of website)
- Advanced WordPress search form based on custom taxonomy and custom meta value
- Custom Search only for my Custom Taxonomy Page – data
- Search and filter with custom field in taxonomy
- Advanced search form with filters for custom taxonomies and custom fields
- Display one post from each term in a custom taxonomy [closed]
- Get the term id belonging to custom taxonomy on a custom single-post-type.php template page
- Dynamically tax_query
- tax_query not working on main query
- Approach for saving a product attribute values with a custom UI in a woocommerce+dokan set up [closed]
- Handling AJAX with custom taxonomy custom fields on add
- Ordering Posts with Custom Taxonomy Terms Array
- How to extract url from get_the_term_list?
- wp_insert_post via shell category not being inserted
- pre_get_posts Tax Query not working for custom author page
- Creating an Archive using a Custom Taxonomy
- Change sub-menu position of custom taxonomy
- AJAX response, edit tags
- Alter post order on taxonomy template
- Display Taxonomy Terms in an option tag with value being the slug
- orderby meta_value breaks taxonomy term archives
- If post has ANY term attached to it, get the first one only
- Locale switching with a “language” taxonomy
- Category slug field missing with registered custom taxonomy
- Custom Post Type Taxonomy not showing
- Permalink help with default Posts and custom Taxonomy
- get the taxonomies terms associated with users
- How can I highlight a top level dashboard menu item created for a custom taxonomy?
- Return the most recently created custom taxonomy
- How to get custom category’s link?
- Edit custom taxonomy description programatically
- why are the term_id and term_taxonomy_id doesn’t match on custom taxonomies, but are duplicates on categories
- Get taxonomy name for the current post
- Duplicate slug/permalink issue
- Getting taxonomies associated with a specified post type
- How to list the taxonomy terms that fit the custom query?
- What’s the best way to add taxonomy’s image in 2017?
- Count of posts by different parameters?
- Proper way to create taxonomy queries
- Need equivalent of single_term_slug
- How to loop custom posts that have an exact match in taxonomy terms?
- True or F False Setting of ‘with_front’ Parameter of Rewrite Is returning Exact Same result
- wp_insert_post not adding taxonomy (using wp_set_object_terms)
- Filter “get_terms” query
- generate random slug when adding taxonomy
- Error 404 in Custom taxonomy with pagination
- Custom post type term names with ampersand in the term name
- WordPress Taxonomy Permalinks – Custom?
- Display custom post term or taxonomy
- Attaching meta box to specific category/taxonomy in custom post type
- Change Permalink to Value of Custom Field
- Display custom post taxonomies
- Custom Taxonomy type in nav menu
- Two taxonomies with the same slug
- Hook function when taxonomy terms change