Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active November 3, 2015 14:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/e89c629e55b24535b54f to your computer and use it in GitHub Desktop.
Save Pebblo/e89c629e55b24535b54f to your computer and use it in GitHub Desktop.
Snippet to display the registrations custom questions within the thank you table - http://take.ms/bp7Ba
<?php
//Do not include the opening PHP tag if you already have one.
function ee_display_questions_on_thank_you_table($registration) {
if( count($registration->answers()) > 0 ) {
?>
<tr>
<th width="50%">
<?php _e("Questions",'event_espresso')?>
</th>
<th width="50%" class="jst-left">
<?php _e("Answers",'event_espresso');?>
</th>
</tr>
<?php
foreach ( $registration->answers() as $answer ) {
if ( $answer instanceof EE_Answer ) {
//d($answer->question());
echo '<tr>';
echo '<td width="50%">';
if ($answer->question() instanceof EE_Question) {
echo $answer->question()->display_text();
echo '<br>';
}
echo '</td>';
echo '<td width="50%" class="jst-left">';
$answer->e_value();
echo '<br>';
echo '</td>';
echo '</tr>';
}
}
}
}
add_action( 'AHEE__thank_you_page_registration_details_template__after_registration_table_row', 'ee_display_questions_on_thank_you_table' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment