Skip to content

Instantly share code, notes, and snippets.

Roland Barker xnau

Block or report user

Report or block xnau

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@xnau
xnau / pdb-total-field-handler.php
Last active Aug 18, 2019
Shows how to set up a Participants Database field that keeps a total of several other fields.
View pdb-total-field-handler.php
<?php
/*
Plugin Name: Participants Database Total Field
Description: Maintains a total of several fields
*/
// this updates the total when the record is updated
add_filter( 'pdb-before_submit_update', 'xnau_update_total_field' );
/**
@xnau
xnau / pdb-allow-html-text.php
Last active Aug 6, 2019
Demonstrates how to allow HTML in Participants Database text fields
View pdb-allow-html-text.php
<?php
/**
* @wordpress-plugin
* Plugin Name: PDB Allow HTML
* Description: Installs a filter allowing HTML in Participants Database text fields
*/
add_filter( 'pdb-text_field_output', 'xnau_allow_html_in_text', 10, 2 );
/**
* allows sanitized HTML in text fields
*
@xnau
xnau / pdb-suspend-email-autop.php
Last active Jul 29, 2019
Shows how to conditionally suspend auto-paragraphs with a Participants Database Email Template
View pdb-suspend-email-autop.php
add_filter( 'pdb-rich_text_filter_mode', 'suspend_rich_text_for_sms', 10, 2 );
// changes the rich text filtering mode according to content
function suspend_rich_text_for_sms( $format_setting, $content ) {
// the setting is only altered if the message is an sms message
if ( content_is_sms( $content ) ) {
$format_setting = 'none';
}
View custom_validation_example.php
<?php
/**
* validates a field submission for a valid URL
*
* @param PDb_Validating_Field $field
* @return null
*/
function xnau_check_valid_url( $field )
{
// first, check to see if it is the field we want to validate
@xnau
xnau / pdb_set_age_value.php
Last active Jul 5, 2019
Demonstrates how to set up a field that shows a person's age in Participants Database
View pdb_set_age_value.php
<?php
/**
* Plugin Name: Participants Database Show Participant's Age
* Description: Sets up a field that shows a person's age
*/
class pdb_set_age_value {
// put the name of your birth date field here
var $birth_date_field = 'birthday';
@xnau
xnau / pdb-update_notify.php
Created Nov 7, 2016
Notify the user when their record is updated by an admin
View pdb-update_notify.php
<?php
/*
Plugin Name: Participants Database Update Notify
Description: Notifies the user when their record is updated
*/
/*
* before the update is stored, send an email notification to the participant
*/
add_filter( 'pdb-before_submit_update', 'pdb_send_record_update_notification' );
@xnau
xnau / pdb-generate-member-id.php
Last active May 22, 2019
Demonstrates a way to provide a unique ID for new signups and new records in Participants Database
View pdb-generate-member-id.php
<?php
/**
* Plugin Name: PDB Generate Member ID
* Description: provides a unique ID for new signups and new records in Participants Database
* Version: 2.0
*/
class pdb_generate_member_id {
/**
@xnau
xnau / pdb-record-usertype.php
Last active May 9, 2019
Custom template demonstrating how to show a record edit form depending on a value in the record
View pdb-record-usertype.php
<?php
/*
* first, check for the value that determines what kind of
* record edit form to show
*/
$type = $this->participant_values['type'];
/*
* now, show the record edit form for that type
*/
@xnau
xnau / pdb-email-cron.php
Last active Apr 20, 2019
Shows how to set up a Participants Database email that will automatically send when conditions are met
View pdb-email-cron.php
<?php
/**
* Plugin Name: PDB Email Cron
* Plugin URI: https://xnau.com/?p=7354
* Description: Provides a basic framework for setting up an automated Participants Database email send
* Version: 1.0
* Author: xnau webdesign
* Author URI: https://xnau.com
* License: GPL2
@xnau
xnau / pdb-multi-field-as-or.php
Last active Apr 9, 2019
When using Participants Database Combo Multisearch, shows how to make the selections within a multiselect field work as OR terms when global filter mode is enabled.
View pdb-multi-field-as-or.php
<?php
/**
* Plugin Name: PDB Multi Field as OR in Filter Search
* Description: make the selections within a multiselect field work as OR terms when
* global filter mode is enabled
*/
add_filter( 'pdb-multisearch_filter_mode', 'xnau_set_multi_field_as_or', 10, 2 );
/**
* sets the filter mode for the terms within a multi select field as an OR instead
You can’t perform that action at this time.