Skip to content

Instantly share code, notes, and snippets.

View xnau's full-sized avatar

Roland Barker xnau

View GitHub Profile
@xnau
xnau / pdb-dynamicfield-cron-updater.php
Last active February 7, 2024 22:46
Shows how to update Participants Database calculated field using a cron.
<?php
/**
* Plugin Name: PDB Dynamic Field Cron Updater
* Description: updates dynamic fields automatically on a WP cron
* Version: 1.0
*/
class PDb_Dynamicfield_Cron_Updater
{
@xnau
xnau / pdb-dynamicfield-update.php
Last active February 7, 2024 18:00
Shows how to update dynamic fields after a signup is submitted
<?php
/**
* Plugin Name: PDB Dynamic Field Updater
* Description: updates dynamic fields automatically after a signup submission
* Version: 1.0
*/
class PDb_Dynamicfield_Update
{
/**
@xnau
xnau / pdb-auto-search-mode.php
Last active December 1, 2023 03:38
Demonstrates a Participants Database plugin that sets the "strict user searches" mode according to the presence of a wildcard in the search term
<?php
/**
* Plugin Name: PDB Auto Search Mode
* Description: switches the "strict user search" mode off if there is a wildcard in the search term
* Author: xnau webdesign
* Version: 1.2
*/
class pdb_auto_search_mode {
@xnau
xnau / pdb-return-to-results.php
Last active November 7, 2024 01:19
Provides a "return to search results" shortcode for Participants Database
<?php
/**
* Plugin Name: PDB Return to Results Shortcode
* Description: adds a shortcode that displays a link to return to the previous search result
* Author: xnau webdesign
* Version: 1.3
*/
class PDb_Search_Return_Link {
@xnau
xnau / pdb-search-input-placeholder.php
Last active November 26, 2023 18:49
Shows how to add a placeholder to the Participants Database standard list search input (deprecated)
<?php
/**
* Plugin Name: PDb Standard Search Input Placeholder
* Description: shows how to set a placeholder value in the standard list search input
*/
add_filter( 'pdb-search_input_attributes', 'xnau_set_search_input_attributes' );
/**
@xnau
xnau / pdb-email-conditionals.php
Last active September 7, 2023 07:27
Shows how to add an additional conditional to a Participants Database email template
<?php
/**
* Plugin Name: PDb Email Conditionals
* Description: shows how to add additional conditional checks to an email template
*/
class PDb_Email_Template_Conditionals {
/**
@xnau
xnau / pdb-override-email-limit.php
Created September 5, 2023 00:38
Shows how to obverride the Participants Database email session limit
<?php
/**
* Plugin Name: PDB Override Email Limit
* Description: sets a new outgoing email limit
* Version: 1.0
*/
// overrides the session email limit with a new limit
add_action( 'pdb-mass_email_session_limit', function($limit){
$limit = 500; // this is your new limit
@xnau
xnau / pdb-custom-image-filename.php
Created August 18, 2023 03:10
Shows how to set a custom filename for an uploaded image
<?php
/**
* Plugin Name: PDB Custom Image Filename
* Description: names an uploaded image file according to other values in the record
* Version: 1.0
*/
// attach the handler function to the filter
add_action( 'pdb-file_upload_filename', 'pdb_set_custom_filename', 10, 3 );
@xnau
xnau / pdb-check-link-match.php
Last active May 7, 2023 19:07
Shows how to set up a duplicate record check on a link-type field
@xnau
xnau / pdb-list-sort-columns.php
Last active June 27, 2025 23:58
Shows how to set up a click-to-sort header for a Participants Database list table template
<?php
/**
* @version 1.1
*
* template for participants list shortcode output
*
* this demonstrates how to add a click-to-sort header to the list
*
*/