Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Shows how to display a single Participants Database record for a logged-in WordPress user.
// this is meant to be used with some kind of plugin that lets you insert php into a page
// the Participants Database field named 'user_login' is expected to have the user's user login value
$current_user = wp_get_current_user();
if ( $current_user->ID ) {
$record_id = Participants_Db::get_record_id_by_term('user_login', $current_user->user_login );
echo do_shortcode( '[pdb_single record_id=' . $record_id . ']' );
} else {
echo 'You must log in to see your record';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment