Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2. /**
  3. * Content Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
  4. *
  5. * @package Event Espresso
  6. * @subpackage templates
  7. * @since 4.6.29
  8. * @author Darren Ethier
  9. *
  10. * Template Args that are available in this template
  11. * @type EE_Attendee $contact
  12. * @type bool $show_gravatar whether to show gravatar or not.
  13. */
  14. $custom_question_output = '';
  15. if( $contact instanceof EE_Attendee ) {
  16. $prev_answer_value = EEM_Answer::instance()->get_var(
  17. array(
  18. array(
  19. 'Registration.ATT_ID' => $contact->ID(),
  20. 'Registration.EVT_ID' => $event->ID(),
  21. 'QST_ID' => 11 // replace with custom question's ID
  22. ),
  23. 'order_by' => array(
  24. 'ANS_ID' => 'DESC'
  25. ),
  26. 'limit' => 1
  27. ),
  28. 'ANS_value' );
  29. if( $prev_answer_value ) {
  30. $custom_question_output = $prev_answer_value . ' - ';
  31. }
  32. }
  33.  
  34. ?>
  35. <?php do_action( 'AHEE__content-espresso_event_attendees__before', $contact, $show_gravatar ); ?>
  36. <li><?php echo $custom_question_output . $contact->lname() . ' ' . $contact->fname(); ?></li>
  37. <?php do_action( 'AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement