You can add a search field to get_terms arguments, which will have wildcards added by WordPress automatically:
$args = array(
'hide_empty' => false,
'search' => $searched_term,
);
get_terms('hotellocation', $args);
This is documented about mid-way down the page here. There are also other similar arguments you could use, such as name__like
, if search
doesn’t work for whatever reason.
Related Posts:
- Retrieve posts by term id custom query
- Display category posts grouped by taxonomy
- restrict_manage_posts not working in 3.3.1
- Filter all queries with a specific taxonomy
- wp_query orderby title and meta key value (WP3.1)
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Taxonomy.php issue with search and filters
- How to List Parent Term Links for Custom Taxonomy With & Without Children?
- Recreating the hierarchy of taxonomies for a dropdown form menu?
- Custom taxonomy query not working with switch_to_blog
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Print terms with taxonomy and metabox value
- Checkbox onclick filtering on the same page
- get the taxonomies terms associated with users
- Rewrite Rules returning wrong data
- Sorting main query by custom taxonomy slug
- WordPress Custom post query sorting does not work
- List related terms + taxonomies
- Search Query for Multiple Terms In Same Taxonomy
- Exclude taxonomy term from all loops, but having it on widget
- Get list of taxonomies associated with users
- query_posts that have custom taxonomy and limiting what shows based on the taxonomy
- Several taxonomy query (like filter)
- Taxonomy archive template that shows posts from more than one taxonomy
- how to access the $query variable inside taxonomy-xxx.php template file?
- Displaying Posts Attached to Custom Taxonomy Terms
- Update Custom Taxonomy Value for a post based on custom date field
- Get 1st parent category id from post
- How to get the term description in a taxonomy term archive query?
- making an index from custom taxonomies and tags of posts (not hierarchical taxonomy)
- Query Multiple Custom Taxonomies
- Query by multiple custom taxonomies
- WP Query : strange behaviour with multiple no-hierarchical tax
- WordPress search form and search result through ACF field in custom taxonomy
- Query pages by child term
- Can I use multi (sub) levels of relation (AND | OR) on custom query?
- Tax Query not working
- Custom taxonomy – query returns an error
- How to perform a search inside a specific taxonomy category
- Adding a query var to taxonomy term archive – gets redirected to the other taxonomy archive page
- add_query_arg to look up page title
- Can I use $query->set() (in a pre_get_posts() hook) with a custom taxonomy in WP 3?
- How can I query for all values of a custom taxonomies?
- query grandchildren taxonomy terms
- Add custom taxonomy fields when creating a new taxonomy
- get_term_by not working when in functions.php
- How to remove “Taxonomy name:” from wp_title
- Widget to display custom taxonomy tag cloud
- Custom Taxonomy Relationship (ex: plant classification)
- Help With issue on pre_get_posts filter in taxonomy
- Custom Taxonomy Images with Advanced Custom Fields
- How to display term description in empty terms archive?
- Query Posts by taxonomy/Taxonomy Child Custom order
- WP_Query search posts by custom post type and custom taxonomy
- 404 for a custom taxonomy?
- How to display featured images for all posts with certain taxonomy label?
- Adding Age Based WordPress Category
- Can you filter wp_dropdown_categories with terms meta?
- Page and Post return 404 with custom taxonomy
- Retrieving an intersection of two terms from two different custom taxonomies via API
- Category list with indent children list below current category
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- What is the most efficient way of implementing a notification system? [closed]
- Remove custom taxonomy column from my custom post type columns
- Get posts by Taxonomy without terms
- Check if custom taxonomy has posts with get_categories()
- How to add images to taxonomy terms? [duplicate]
- Echo custom taxonomy slug
- Admin (All posts) stop responding problem
- Why get_page_template() doesn’t show taxonomy template file name?
- Remove a href from this code
- Adding a second custom taxonomy to a custom post type (both shown in its table)?
- custom post type, hide or disable the status line in publish meta box
- Get post terms from multiple custom taxonomies
- How to get attached image to taxonomy..?
- delete term from taxonomy and assign in new one
- Template file renders on local install, not on web
- Replicate Drupal form options as taxonomies?
- custom taxonomies label in hebrew
- Amend taxonomy to search in wordpress admin
- Unique taxonomy for post
- filter for thumbnail not working for custom taxonomy term
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Change link of taxonomy when get_the_term_list( is used?
- Invalid taxonomy with custom script
- Multi level archive
- Displaying posts from a custom category
- wp_insert_term doesn’t work with custom post type’s tax
- How to add meta fields to custom taxonomy add/edit page?
- Passing a variable to register_taxonomy()
- Broken paths on taxonomies after changing permalink to post name
- Query Number of Loaded Posts in Loop
- Trying to achieve row posts below category with multiple loops in custom tax
- How to get tags with custom taxonomy field?
- Getting Catategory / Taxonomy Description on Non-archive Pages
- Add Gutenberg editor to edit taxonomy (category) page
- post_type_link not working for posts without terms
- Why my archive title isn’t showing?
- Two taxonomies with the same slug
- Hook function when taxonomy terms change