Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Last active October 13, 2025 09:19
Show Gist options
  • Save andrasguseo/a9f6e722bd17eacbf6f093f7329d57a4 to your computer and use it in GitHub Desktop.
Save andrasguseo/a9f6e722bd17eacbf6f093f7329d57a4 to your computer and use it in GitHub Desktop.

Revisions

  1. andrasguseo revised this gist Oct 13, 2025. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion email.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    <?php
    /**
    * Block: RSVP
    * Form Email
    * Field: Form Email
    *
    * This is a template override that will lock the 'email' field with the email of the user who is logged in,
    * if the "Tickets > Settings > General > Require users to log in before they RSVP" is enabled.
    2 changes: 1 addition & 1 deletion name.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    <?php
    /**
    * Block: RSVP
    * Form Name
    * Field: Form Name
    *
    * This is a template override that will lock the 'name' field with the name of the user who is logged in,
    * if the "Tickets > Settings > General > Require users to log in before they RSVP" is enabled.
  2. andrasguseo revised this gist Oct 13, 2025. 2 changed files with 6 additions and 2 deletions.
    4 changes: 3 additions & 1 deletion email.php
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,9 @@
    *
    * See more documentation about our Blocks Editor templating system.
    *
    * Plugins requires: Event Tickets
    * Plugins required: Event Tickets
    *
    * Tags: RSVP, template override, attendee registration
    *
    * @link https://evnt.is/1amp Help article for RSVP & Ticket template files.
    *
    4 changes: 3 additions & 1 deletion name.php
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,9 @@
    *
    * See more documentation about our Blocks Editor templating system.
    *
    * Plugins requires: Event Tickets
    * Plugins required: Event Tickets
    *
    * Tags: RSVP, template override, attendee registration
    *
    * @link https://evnt.is/1amp Help article for RSVP & Ticket template files.
    *
  3. andrasguseo revised this gist Oct 13, 2025. 2 changed files with 4 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions email.php
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,8 @@
    *
    * See more documentation about our Blocks Editor templating system.
    *
    * Plugins requires: Event Tickets
    *
    * @link https://evnt.is/1amp Help article for RSVP & Ticket template files.
    *
    * @since 4.12.3
    2 changes: 2 additions & 0 deletions name.php
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,8 @@
    *
    * See more documentation about our Blocks Editor templating system.
    *
    * Plugins requires: Event Tickets
    *
    * @link https://evnt.is/1amp Help article for RSVP & Ticket template files.
    *
    * @since 4.12.3
  4. andrasguseo created this gist Jun 26, 2025.
    60 changes: 60 additions & 0 deletions email.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    <?php
    /**
    * Block: RSVP
    * Form Email
    *
    * This is a template override that will lock the 'email' field with the email of the user who is logged in,
    * if the "Tickets > Settings > General > Require users to log in before they RSVP" is enabled.
    * If the setting is disabled, the field content can be changed.
    *
    * Override this template in your own theme by creating a file at:
    * [your-theme]/tribe/tickets/v2/rsvp/form/fields/email.php
    *
    * This is a template override for the following file:
    * event-tickets/src/views/v2/rsvp/form/fields/email.php
    *
    * See more documentation about our Blocks Editor templating system.
    *
    * @link https://evnt.is/1amp Help article for RSVP & Ticket template files.
    *
    * @since 4.12.3
    * @since 5.0.0 Updated the input name used for submitting data.
    *
    * @version 5.0.0
    */

    /**
    * Set the default value for the email on the RSVP form.
    *
    * @param string $email The email value.
    * @param Tribe__Tickets__Editor__Template $template The template object.
    *
    * @since 4.9
    */
    $email = apply_filters( 'tribe_tickets_rsvp_form_email', '', $this );
    // Check if logging in is required for RSVPs.
    $login_required = tribe_get_option( 'ticket-authentication-requirements', false );
    $readonly = array_key_exists( 'event-tickets_rsvp', array_flip( $login_required ) ) ? 'readonly' : '';
    ?>
    <div class="tribe-common-b1 tribe-common-b2--min-medium tribe-tickets__form-field tribe-tickets__form-field--required">
    <label
    class="tribe-tickets__form-field-label"
    for="tribe-tickets-rsvp-email-<?php echo esc_attr( $rsvp->ID ); ?>"
    >
    <?php esc_html_e( 'Email', 'event-tickets' ); ?><span class="screen-reader-text"><?php esc_html_e( 'required', 'event-tickets' ); ?></span>
    <span class="tribe-required" aria-hidden="true" role="presentation">*</span>
    </label>
    <input
    type="email"
    class="tribe-common-form-control-text__input tribe-tickets__form-field-input tribe-tickets__rsvp-form-field-email"
    name="tribe_tickets[<?php echo esc_attr( absint( $rsvp->ID ) ); ?>][attendees][0][email]"
    id="tribe-tickets-rsvp-email-<?php echo esc_attr( $rsvp->ID ); ?>"
    value="<?php echo esc_attr( $email ); ?>"
    required
    placeholder="<?php esc_attr_e( '[email protected]', 'event-tickets' ); ?>"
    <?php
    // Set the field readonly if needed.
    echo $readonly;
    ?>
    >
    </div>
    60 changes: 60 additions & 0 deletions name.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    <?php
    /**
    * Block: RSVP
    * Form Name
    *
    * This is a template override that will lock the 'name' field with the name of the user who is logged in,
    * if the "Tickets > Settings > General > Require users to log in before they RSVP" is enabled.
    * If the setting is disabled, the field content can be changed.
    *
    * Override this template in your own theme by creating a file at:
    * [your-theme]/tribe/tickets/v2/rsvp/form/fields/name.php
    *
    * This is a template override for the following file:
    * event-tickets/src/views/v2/rsvp/form/fields/name.php
    *
    * See more documentation about our Blocks Editor templating system.
    *
    * @link https://evnt.is/1amp Help article for RSVP & Ticket template files.
    *
    * @since 4.12.3
    * @since 5.0.0 Updated the input name used for submitting.
    *
    * @version 5.0.0
    */

    /**
    * Set the default Full Name for the RSVP form
    *
    * @param string $name The name value.
    * @param Tribe__Tickets__Editor__Template $template The template object.
    *
    * @since 4.9
    */
    $name = apply_filters( 'tribe_tickets_rsvp_form_full_name', '', $this );
    // Check if logging in is required for RSVPs.
    $login_required = tribe_get_option( 'ticket-authentication-requirements', false );
    $readonly = array_key_exists( 'event-tickets_rsvp', array_flip( $login_required ) ) ? 'readonly' : '';
    ?>
    <div class="tribe-common-b1 tribe-common-b2--min-medium tribe-tickets__form-field tribe-tickets__form-field--required">
    <label
    class="tribe-tickets__form-field-label"
    for="tribe-tickets-rsvp-name-<?php echo esc_attr( $rsvp->ID ); ?>"
    >
    <?php esc_html_e( 'Name', 'event-tickets' ); ?><span class="screen-reader-text"><?php esc_html_e( 'required', 'event-tickets' ); ?></span>
    <span class="tribe-required" aria-hidden="true" role="presentation">*</span>
    </label>
    <input
    type="text"
    class="tribe-common-form-control-text__input tribe-tickets__form-field-input tribe-tickets__rsvp-form-field-name"
    name="tribe_tickets[<?php echo esc_attr( absint( $rsvp->ID ) ); ?>][attendees][0][full_name]"
    id="tribe-tickets-rsvp-name-<?php echo esc_attr( $rsvp->ID ); ?>"
    value="<?php echo esc_attr( $name ); ?>"
    required
    placeholder="<?php esc_attr_e( 'Your Name', 'event-tickets' ); ?>"
    <?php
    // Set the field readonly if needed.
    echo $readonly;
    ?>
    >
    </div>