{"id":943590,"date":"2015-02-19T07:40:43","date_gmt":"2015-02-19T15:40:43","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/"},"modified":"2015-02-20T06:20:12","modified_gmt":"2015-02-20T14:20:12","slug":"change-search-field-with-a-select-option","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/","title":{"rendered":"Change Search field with a select option"},"content":{"rendered":"<p>Hi, please i&#8217;m trying to change the default serch field and city search fild with a select.<br \/>\nI have this two query for my db:<br \/>\n<code>SELECT post_title FROM wp_posts WHERE post_type = &#039;tribe_events&#039;GROUP BY post_title<\/code><br \/>\nfor the event title and<br \/>\n<code>SELECT meta_value FROM plkt_postmeta WHERE meta_key = &#039;_venueCity&#039;GROUP BY meta_value<\/code><br \/>\nfor the City.<br \/>\nI need (a customer is asking this) to have two select with options populated from this two queries.<br \/>\nI&#8217;m working on the-events-calendar-class.php at line 4475:<\/p>\n<pre><code>if ( tribe_get_option( &#039;tribeDisableTribeBar&#039;, false ) == false ) {\n  $filters[&#039;tribe-bar-search&#039;] = array(\n\t\t&#039;name&#039;    =&gt; &#039;tribe-bar-search&#039;,\n\t\t&#039;caption&#039; =&gt; __( &#039;Search&#039;, &#039;tribe-events-calendar&#039; ),\n\t\t&#039;html&#039;    =&gt; &#039;&lt;input type=&quot;text&quot; name=&quot;tribe-bar-search&quot; id=&quot;tribe-bar-search&quot; value=&quot;&#039; . $value . &#039;&quot; placeholder=&quot;&#039; . __( &#039;Search&#039;, &#039;tribe-events-calendar&#039; ) . &#039;&quot;&gt;&#039;\n\t\t\t\t);\n\t\t\t}<\/code><\/pre>\n<p>and on tribe-geoloc.class.php at about line 263:<\/p>\n<pre><code>$filters[&#039;tribe-bar-geoloc&#039;] = array(\n\t&#039;name&#039;    =&gt; &#039;tribe-bar-geoloc&#039;,\n\t&#039;caption&#039; =&gt; __( &#039;Near&#039;, &#039;tribe-events-calendar-pro&#039; ),\n\t&#039;html&#039;    =&gt; &#039;&lt;input type=&quot;hidden&quot; name=&quot;tribe-bar-geoloc-lat&quot; id=&quot;tribe-bar-geoloc-lat&quot; value=&quot;&#039; . esc_attr( $lat ) . &#039;&quot; \/&gt;&lt;input type=&quot;hidden&quot; name=&quot;tribe-bar-geoloc-lng&quot; id=&quot;tribe-bar-geoloc-lng&quot; value=&quot;&#039; . esc_attr( $lng ) . &#039;&quot; \/&gt;&lt;input type=&quot;text&quot; class=&quot;luogo&quot; name=&quot;tribe-bar-geoloc&quot; id=&quot;tribe-bar-geoloc&quot; value=&quot;&quot; placeholder=&quot;&#039; . __( &#039;Location&#039;, &#039;tribe-events-calendar-pro&#039; ) . &#039;&quot;&gt;&lt;select id=&quot;tribe-luogo&quot; name=&quot;tribe-bar-geoloc&quot;&gt;&lt;option value=&quot;Milano&quot;&gt;Milano&lt;\/option&gt;&lt;option value=&quot;Roma&quot;&gt;Roma&lt;\/option&gt;&lt;\/select&gt;&#039;\n\t\t\t\t);<\/code><\/pre>\n<p>But i can&#8217;t figure out how to make those &#8216;html&#8217; in the array to become a select populated with my query.<br \/>\nI can manually create the select and put my values, but i need them to be updated from database.<br \/>\nCan you help please?<br \/>\nBest regards.<\/p>\n","protected":false},"template":"","class_list":["post-943590","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Change Search field with a select option -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change Search field with a select option -\" \/>\n<meta property=\"og:description\" content=\"Hi, please i&#8217;m trying to change the default serch field and city search fild with a select. I have this two query for my db: SELECT post_title FROM wp_posts WHERE post_type = &#039;tribe_events&#039;GROUP BY post_title for the event title and SELECT meta_value FROM plkt_postmeta WHERE meta_key = &#039;_venueCity&#039;GROUP BY meta_value for the City. I need [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-02-20T14:20:12+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/\",\"name\":\"Change Search field with a select option -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-02-19T15:40:43+00:00\",\"dateModified\":\"2015-02-20T14:20:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Filter Bar\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Change Search field with a select option\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Change Search field with a select option -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/","og_locale":"en_US","og_type":"article","og_title":"Change Search field with a select option -","og_description":"Hi, please i&#8217;m trying to change the default serch field and city search fild with a select. I have this two query for my db: SELECT post_title FROM wp_posts WHERE post_type = &#039;tribe_events&#039;GROUP BY post_title for the event title and SELECT meta_value FROM plkt_postmeta WHERE meta_key = &#039;_venueCity&#039;GROUP BY meta_value for the City. I need [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/","article_modified_time":"2015-02-20T14:20:12+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/","name":"Change Search field with a select option -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-02-19T15:40:43+00:00","dateModified":"2015-02-20T14:20:12+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/change-search-field-with-a-select-option\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Filter Bar","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/"},{"@type":"ListItem","position":5,"name":"Change Search field with a select option"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/943590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/943590\/revisions"}],"predecessor-version":[{"id":943771,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/943590\/revisions\/943771"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=943590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}