{"id":1300248,"date":"2017-06-19T16:44:55","date_gmt":"2017-06-19T23:44:55","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/"},"modified":"2017-06-19T16:44:55","modified_gmt":"2017-06-19T23:44:55","slug":"custom-select-field","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/","title":{"rendered":"Custom Select Field"},"content":{"rendered":"<p>Hey everyone! So i am fairly new to customizing the The Events Calendar. I have the TEC Pro with Events Tickets Pro. I found the place to customize the select field event-ticket-plus &gt; src &gt; views &gt; meta &gt; select.php.<\/p>\n<p>i am creating a website for a client who is putting together a car show events website. the participants can submit their cars they have in stock and showcase them on their profiles. <\/p>\n<p>I&#8217;ve written a php function that dynamically pulls their car information and makes them into options for a dropdown form using the information they provided in that list in a foreach loop.<\/p>\n<p>so my question is&#8230;how do I create my own select.php without having to override the current template? I want to have those drop downs as they register for each ticket without having to manually input there cars in a regular text box (the client is adamant about this feature).<\/p>\n<p>here is my code. Right now i have it as a shortcode for testing purposes! <\/p>\n<pre><code>function getcarsdata() {\n\t$user_id = wp_get_current_user();\n\t$cars = bp_get_profile_field_data(&#039;field=Cars&amp;user_id=&#039;.bp_loggedin_user_id());\n\t\n\t$car = explode(&#039;|&#039;, $cars);\n\techo &#039;&lt;h2&gt;Testing loop&lt;\/h2&gt; &lt;form&gt;&lt;select&gt;&#039;;\n\t\n\tforeach($car as $key =&gt;$carname) {\n\t\t\n\t\techo &#039;&lt;option value=&quot;&#039;.$carname.&#039;&quot;&gt; &#039; .$carname. &#039;&lt;\/option&gt;&#039;;\n\t\t\n\t}\n\techo &#039;&lt;\/select&gt;&lt;\/form&gt;end of loop&#039;;\n}\nadd_shortcode (&#039;usercars&#039;, &#039;getcarsdata&#039;);<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1300248","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>Custom Select Field -<\/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\/custom-select-field\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom Select Field -\" \/>\n<meta property=\"og:description\" content=\"Hey everyone! So i am fairly new to customizing the The Events Calendar. I have the TEC Pro with Events Tickets Pro. I found the place to customize the select field event-ticket-plus &gt; src &gt; views &gt; meta &gt; select.php. i am creating a website for a client who is putting together a car show [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/\",\"name\":\"Custom Select Field -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-06-19T23:44:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/#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\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Tickets Plus\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Custom Select Field\"}]},{\"@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":"Custom Select Field -","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\/custom-select-field\/","og_locale":"en_US","og_type":"article","og_title":"Custom Select Field -","og_description":"Hey everyone! So i am fairly new to customizing the The Events Calendar. I have the TEC Pro with Events Tickets Pro. I found the place to customize the select field event-ticket-plus &gt; src &gt; views &gt; meta &gt; select.php. i am creating a website for a client who is putting together a car show [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/","name":"Custom Select Field -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-06-19T23:44:55+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-select-field\/#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":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Event Tickets Plus","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/"},{"@type":"ListItem","position":5,"name":"Custom Select Field"}]},{"@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\/1300248","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\/1300248\/revisions"}],"predecessor-version":[{"id":1319626,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1300248\/revisions\/1319626"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1300248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}