Create a custom taxonomy that will be used to create and filter markers in a Google Map

Here’s a fully working example to get you started. Register the “marker” taxonomy register_taxonomy( ‘marker’, ‘post’, array( ‘hierarchical’ => false, ‘update_count_callback’ => ‘_update_post_term_count’, ‘label’ => __( ‘Markers’, ‘textdomain’ ), ‘labels’ => array( ‘name’ => __( ‘Markers’, ‘textdomain’ ), ‘singular_name’ => __( ‘Marker’, ‘textdomain’ ), ‘menu_name’ => _x( ‘Markers’, ‘Admin menu name’, ‘textdomain’ ), ‘search_items’ => … Read more

A way to query custom taxonomies by name

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 … Read more