Created
January 21, 2023 18:01
-
-
Save xnau/4ead0f3c04d4f4d8930f247848b21be2 to your computer and use it in GitHub Desktop.
Shows how to control which Participants Database fields are availble for editing based on the user's approval status
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 | |
/* | |
* when the user opens their record for editing, we check on their approval status | |
* and then select the shortcode to use based on that. | |
*/ | |
switch ( $this->participant_values['approved'] ) { | |
case 'yes' : | |
echo do_shortcode( '[pdb_record]' ); | |
break; | |
case 'no': | |
case null: | |
echo do_shortcode( '[pdb_record groups=main]' ); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment