Skip to content

Instantly share code, notes, and snippets.

Embed
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.
<?php
/*
* shows a single record display based on a value in the record
*/
if ( $this->participant_id ) : ?>
<?php
switch ( $this->participant_values['type'] ) {
case 'player':
echo do_shortcode( '[pdb_single groups="contact,player"]' );
break;
case 'parent':
echo do_shortcode( '[pdb_single groups="contact,parent"]' );
break;
}
?>
<?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
You can’t perform that action at this time.