Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Shows how to use a value in the record to determine which fields to show in the Participants Database single record display.
* shows a single record display based on a value in the record
if ( $this->participant_id ) : ?>
switch ( $this->participant_values['type'] ) {
case 'player':
echo do_shortcode( '[pdb_single groups="contact,player"]' );
case 'parent':
echo do_shortcode( '[pdb_single groups="contact,parent"]' );
<?php else : // content to show if no record is found ?>
<?php $error_message = Participants_Db::plugin_setting( 'no_record_error_message', '' );
if ( ! empty( $error_message ) ) : ?>
<p class="alert alert-error"><?php echo $error_message ?></p>
<?php endif ?>
<?php endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment