Skip to content

Instantly share code, notes, and snippets.

@xnau
Last active March 22, 2021 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnau/f12c0ca1aa9b9cb499fb40a7aaf2a21b to your computer and use it in GitHub Desktop.
Save xnau/f12c0ca1aa9b9cb499fb40a7aaf2a21b to your computer and use it in GitHub Desktop.
Custom template demonstrating how to show a Participants Database record edit form depending on a value in the record
<?php
/*
* first, check for the value that determines what kind of
* record edit form to show
*/
$type = $this->participant_values['type'];
/*
* now, show the record edit form for that type
*/
switch ( $type ) {
case 'parent':
echo do_shortcode('[pdb_record groups="common,coach"]');
break;
case 'player':
echo do_shortcode('[pdb_record groups="common,player"]');
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment