Skip to content

Instantly share code, notes, and snippets.

@xnau
Last active March 11, 2025 11:43
Show Gist options
  • Save xnau/cc853f90967a19377b58a37a3d7dad52 to your computer and use it in GitHub Desktop.
Save xnau/cc853f90967a19377b58a37a3d7dad52 to your computer and use it in GitHub Desktop.
Shows how to filter a Participants Database list display based on data from the user's Participants Database record
<?php
/**
* list of records based on the user's data
*
* the name of the user's group is in a field named group_membership
* when they open the page, the list shortcode is filtered to only show members of the same group
*
*/
if ( is_user_logged_in() ) :
$profileuser = new \pdbwpu\users_record();
$users_group = $profileuser->pdb_record()['group_membership'];
$filter = 'group_membership=' . $users_group;
echo do_shortcode( '[pdb_list filter="' . $filter . '"]' );
else:
?>
<p>You must be logged in to view this list</p>
<?php
endif;
@ahmedappe
Copy link

I want to enable Combo Multisearch on [pbd_list template=userfilter]

Help me!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment