Skip to content

Instantly share code, notes, and snippets.

View xnau's full-sized avatar

Roland Barker xnau

View GitHub Profile
@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-return-to-results.php
Last active November 21, 2023 18:26
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 ling to return to the previous search result
* Author: xnau webdesign
* Version: 1.3
*/
class PDb_Search_Return_Link {
@xnau
xnau / pdb-generate-member-id.php
Last active October 10, 2023 07:00
Demonstrates a way to generate and provide a unique ID for new signups and new records in Participants Database
<?php
/**
* Plugin Name: PDB Generate Member ID
* Description: provides a unique ID for new signups and new records in Participants Database
* Version: 2.2
*/
class pdb_generate_member_id {
/**
@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-contact-form-additions.php
Last active June 8, 2023 22:20
Demonstrates how to add fields to a Participants Database Contact Form
<?php
/**
* Plugin Name: PDB Contact Form Additions
* Description: adds additional fields to the Participants Database contact form
* Version: 2.1
*/
add_action( 'pdbcff-before_message_area', 'pdbcfa_add_fields' );
/**
* inserts additional fields into the contact form
@xnau
xnau / pdb-wp-user-shortcodes.php
Last active May 18, 2023 10:08
Provides shortcodes for showing Participants Database content according to the logged-in WordPress user.
<?php
/**
* Plugin Name: PDB WP User Shortcodes
* Description: defines several shortcodes for use with Participants Database and WordPress Users
*/
class PDb_User_List_Shortcodes {
/**
* @var string name of the user ID field
@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 April 20, 2023 06:31
Shows how to set up a click-to-sort header for a Participants Database list table template
<?php
/**
* @version 1.0
*
* template for participants list shortcode output
*
* this demonstrates how to add a click-to-sort header to the list
*
*/