Last active
March 22, 2021 04:25
-
-
Save xnau/eff6f14f55f9115e9358eeec7821e882 to your computer and use it in GitHub Desktop.
Demonstrates how to show a different Participants Database record edit form depending on a value in the record.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// determine the approval status of the record and show the appropriate shortcode | |
switch ( $this->participant_values['approved'] ) { | |
case 'yes' : | |
echo do_shortcode( '[pdb_record groups="main,address,personal"]' ); | |
break; | |
case 'no': | |
echo do_shortcode( '[pdb_record groups="main"]' ); | |
break; | |
case null: // show this if there is no valid record | |
echo do_shortcode('[pdb_record]'); | |
} |
General instructions on using Participants Database custom templates:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The idea here is that some members will have access to more of their record if they are approved. You can adapt this to any kind of value test in the record to determine which record edit form to display.
The "null" test is needed in case the page is opened with no valid private ID.