Skip to content

Instantly share code, notes, and snippets.

@xnau
Created January 21, 2023 18:01
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/4ead0f3c04d4f4d8930f247848b21be2 to your computer and use it in GitHub Desktop.
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
<?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