Created
February 28, 2024 18:15
-
-
Save xnau/307db68446303a235210ec469fe58dab to your computer and use it in GitHub Desktop.
Demonstrates a simple way to control the Participants Database list display based on the logged-in user
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 | |
/** | |
* participants database list template that shows special content for logged-in users | |
*/ | |
if ( is_user_logged_in() ) | |
{ | |
do_shortcode( '[pdb_list search=true template="edit-link"]' ); | |
} | |
else | |
{ | |
do_shortcode( '[pdb_list search=true]'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is pretty straightforward, after checking on the user's logged-in status, you can determine which shortcode is used to display the list. The shortcode in the "do_shortcode" function can be anything you need it to be.
Be sure to read this article to understand where to place this file: Using Participants Database Custom Templates
Use this template by placing a shortcode like this on the page:
[pdb_list template=usercontent]