{"id":1962465,"date":"2024-08-17T09:06:40","date_gmt":"2024-08-17T13:06:40","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?p=1962465"},"modified":"2024-08-17T09:08:53","modified_gmt":"2024-08-17T13:08:53","slug":"getting-the-names-of-additional-guests-on-the-rsvp-form","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/getting-the-names-of-additional-guests-on-the-rsvp-form\/","title":{"rendered":"Getting the names of additional guests on the RSVP form"},"content":{"rendered":"\n<p>When using the RSVP functionality of Event Tickets, you&#8217;ll notice that only the main guest is asked or is required to submit their name and email address on the RSVP form. However, there may be a time when you need the names of the other guests that the main guests is bringing with. For this, we will tap on the Attendee Information feature of Event Tickets Plus and tweak it a bit to conform with our use case.<\/p>\n\n\n\n<p>The steps are as follows:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Post Titles\">Attendee Information<\/h2>\n\n\n\n<p>Add a text field called &#8220;Guest Name&#8221; on the Attendee Information setting of your RSVP.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/08\/image-1024x494.png\" alt=\"\" class=\"wp-image-1962466\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/08\/image-1024x494.png 1024w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/08\/image-300x145.png 300w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/08\/image-768x370.png 768w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2024\/08\/image.png 1388w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Post Titles\">Tweak using <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/customizing-template-files-2\/\">template file customization<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Copy the <code>\\wp-content\\plugins\\event-tickets-plus\\src\\views\\v2\\components\\meta\\text.php<\/code> file to your <code>[theme or child-theme]\/tribe\/tickets-plus\/v2\/components\/meta\/<\/code> folder to override it.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Edit the &#8220;target&#8221; file (the one in your theme or child-theme folder) so it contains the code below, which does the following: It appropriately requires the guest name field for all other attendees and does not show the field to the main guest.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$multiline = Tribe__Utils__Array::get( $field, &#x5B; &#039;extra&#039;, &#039;multiline&#039; ], null );\n\nif ( $field-&gt;slug == &#039;guest-name&#039; ) {\n\tif ( $attendee_id === 0 ) {\n\t\t$required = false;\n\t}\n}\n?&gt;\n&lt;div\n\t&lt;?php tribe_classes( $classes ); ?&gt;\n\t&lt;?php tribe_attributes( $attributes ); ?&gt;\n&gt;\n&lt;?php if ( $attendee_id === 0 &amp;&amp; $field-&gt;slug == &#039;guest-name&#039; ) { return; } else { ?&gt;\n\t&lt;label\n\t\tclass=&quot;tribe-tickets__form-field-label&quot;\n\t\tfor=&quot;&lt;?php echo esc_attr( $field_id ); ?&gt;&quot;\n\t&gt;&lt;?php echo wp_kses_post( $field-&gt;label ); ?&gt;&lt;?php tribe_required_label( $required ); ?&gt;&lt;\/label&gt;\n\t&lt;div class=&quot;tribe-tickets__form-field-input-wrapper&quot;&gt;\n\t\t&lt;?php if ( $multiline ) : ?&gt;\n\t\t\t&lt;textarea\n\t\t\t\tid=&quot;&lt;?php echo esc_attr( $field_id ); ?&gt;&quot;\n\t\t\t\tclass=&quot;tribe-common-form-control-text__input tribe-tickets__form-field-input&quot;\n\t\t\t\tname=&quot;&lt;?php echo esc_attr( $field_name ); ?&gt;&quot;\n\t\t\t\tplaceholder=&quot;&lt;?php echo esc_attr( $placeholder ); ?&gt;&quot;\n\t\t\t\t&lt;?php tribe_required( $required ); ?&gt;\n\t\t\t\t&lt;?php tribe_disabled( $disabled ); ?&gt;\n\t\t\t&gt;&lt;?php echo esc_textarea( $value ); ?&gt;&lt;\/textarea&gt;\n\t\t&lt;?php else : ?&gt;\n\t\t\t&lt;input\n\t\t\t\ttype=&quot;text&quot;\n\t\t\t\tid=&quot;&lt;?php echo esc_attr( $field_id ); ?&gt;&quot;\n\t\t\t\tclass=&quot;tribe-common-form-control-text__input tribe-tickets__form-field-input&quot;\n\t\t\t\tname=&quot;&lt;?php echo esc_attr( $field_name ); ?&gt;&quot;\n\t\t\t\tvalue=&quot;&lt;?php echo esc_attr( $value ); ?&gt;&quot;\n\t\t\t\tplaceholder=&quot;&lt;?php echo esc_attr( $placeholder ); ?&gt;&quot;\n\t\t\t\t&lt;?php tribe_required( $required ); ?&gt;\n\t\t\t\t&lt;?php tribe_disabled( $disabled ); ?&gt;\n\t\t\t\/&gt;\n\t\t&lt;?php endif; ?&gt;\n\t\t&lt;?php if ( ! empty( $description ) ) : ?&gt;\n\t\t\t&lt;div class=&quot;tribe-common-b3 tribe-tickets__form-field-description&quot;&gt;\n\t\t\t\t&lt;?php echo wp_kses_post( $description ); ?&gt;\n\t\t\t&lt;\/div&gt;\n\t\t&lt;?php endif; ?&gt;\n\t&lt;\/div&gt;\n&lt;?php } ?&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p>That&#8217;s it and Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using the RSVP functionality of Event Tickets, you&#8217;ll notice that only the main guest is asked or is required to submit their name and email address on the RSVP form. However, there may be a time when you need the names of the other guests that the main guests is bringing with. For this,&#8230;<\/p>\n","protected":false},"author":63,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[24,59,79,84,88],"tags":[73],"stellar-product-taxonomy":[155,156],"class_list":["post-1962465","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-customizing-resources","category-snippets","category-theming-overview","category-tickets","tag-rsvp","stellar-product-taxonomy-event-tickets","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP &amp; Functions"},{"value":79,"label":"Snippets"},{"value":84,"label":"Templating &amp; Layout"},{"value":88,"label":"Ticketing"}],"post_tag":[{"value":73,"label":"rsvp"}],"stellar-product-taxonomy":[{"value":155,"label":"Event Tickets"},{"value":156,"label":"Event Tickets Plus"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Tristan","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/tristan\/"},"comment_info":0,"category_info":[{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":110,"filter":"raw","term_order":"0","cat_ID":24,"category_count":110,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP &amp; Functions","slug":"customizing-resources","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":101,"filter":"raw","term_order":"0","cat_ID":59,"category_count":101,"category_description":"","cat_name":"PHP &amp; Functions","category_nicename":"customizing-resources","category_parent":24},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":136,"filter":"raw","term_order":"0","cat_ID":79,"category_count":136,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0},{"term_id":84,"name":"Templating &amp; Layout","slug":"theming-overview","term_group":0,"term_taxonomy_id":84,"taxonomy":"category","description":"","parent":24,"count":59,"filter":"raw","term_order":"0","cat_ID":84,"category_count":59,"category_description":"","cat_name":"Templating &amp; Layout","category_nicename":"theming-overview","category_parent":24},{"term_id":88,"name":"Ticketing","slug":"tickets","term_group":0,"term_taxonomy_id":88,"taxonomy":"category","description":"","parent":61,"count":83,"filter":"raw","term_order":"0","cat_ID":88,"category_count":83,"category_description":"","cat_name":"Ticketing","category_nicename":"tickets","category_parent":61}],"tag_info":[{"term_id":73,"name":"rsvp","slug":"rsvp","term_group":0,"term_taxonomy_id":73,"taxonomy":"post_tag","description":"","parent":0,"count":7,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1962465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1962465"}],"version-history":[{"count":3,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1962465\/revisions"}],"predecessor-version":[{"id":1962469,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1962465\/revisions\/1962469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1962465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1962465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1962465"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1962465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}