Skip to content

Instantly share code, notes, and snippets.

@vicskf
Created January 17, 2018 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vicskf/8a6e772c839e3fcdcd8e84faac8589f7 to your computer and use it in GitHub Desktop.
Save vicskf/8a6e772c839e3fcdcd8e84faac8589f7 to your computer and use it in GitHub Desktop.
Event Tickets Plus > Attendee Meta > Workaround for users not being able to edit their submitted data
<?php
/**
* Renders the meta fields for order editing
*
* Override this template in your own theme by creating a file at:
*
* [your-theme]/tribe-events/tickets-plus/orders-edit-meta.php
*
* @version 4.4.3
*
*/
$ticket = get_post( $attendee['product_id'] );
if ( empty( $ticket ) ) {
?>
<p><?php esc_html_e( 'Ticket deleted: attendee info cannot be updated.', 'event-tickets-plus' ); ?></p>
<?php
return;
}
$meta = Tribe__Tickets_Plus__Main::instance()->meta();
$meta_enabled = get_post_meta( $ticket->ID, '_tribe_tickets_meta', true );
if ( $meta_enabled ) {
?>
<div class="tribe-event-tickets-plus-meta" id="tribe-event-tickets-plus-meta-<?php echo esc_attr( $ticket->ID ); ?>" data-ticket-id="<?php echo esc_attr( $ticket->ID ); ?>">
<a class="attendee-meta toggle show"><?php esc_html_e( 'Toggle attendee info', 'event-tickets-plus' ); ?></a>
<div class="attendee-meta-row">
<?php
$meta_fields = $meta->get_meta_fields_by_ticket( $ticket->ID );
foreach ( $meta_fields as $field ) {
echo $field->render( $attendee['attendee_id'] );
}
?>
</div>
</div>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment