Skip to content

Instantly share code, notes, and snippets.

View xnau's full-sized avatar

Roland Barker xnau

View GitHub Profile
@xnau
xnau / pdb-single-conditional-show.php
Last active October 2, 2022 19:13
Single record template for Participants Database that demonstrates how to skip showing a field based on another value in the record.
<?php
/**
* @name pdb single template
* @version 2.2
*
* demonstrates how to skip displaying a field based on a value in the record
*
* you will need to change 3 values:
* 'conditional_field' should be the name of the field you may want to skip showing
* 'check_field' should be the name of the record value you are checking
@xnau
xnau / pdb-signup-radioselect.php
Last active September 24, 2022 17:38
Template for a Participants Database signup form that demonstrates how to disable or enable a field based on the selected value of another field
<?php
/**
*
* template for the signup form
*
* shows an example of letting the selected value of a radio control enable or disable another field
*
*/
?>
<script>
@xnau
xnau / pdb-list-record-columns.php
Last active August 17, 2022 18:14
Demonstrates a custom template for showing a Participant Database list in "reverse" form: rows as fields and columns as records.
<?php
/**
* @version 1.1
*
* PDbList template demonstrating how to show a "reverse" table with records as
* columns and fields as rows
*
*/
/** @var PDb_List $this */
@xnau
xnau / pdb-with-selected-send-signup-email.php
Created July 20, 2022 19:11
Tests adding the "send signup" item to the Participants Database With Selected admin list function
<?php
/**
* Plugin Name: PDb With Selected Signup Email
* Description: adds the send signup email item to the "with selected" function
*/
add_filter( 'pdb-admin_list_with_selected_actions', function ( $actions ) {
return $actions + array(
'send signup email' => 'send_signup_email'
);
@xnau
xnau / pdb_custom_log_template.php
Last active July 19, 2022 18:32
Demonstrates how to define a custom template component set for the Participant Log add-on
<?php
/**
* Plugin Name: PDB Custom Log Template
* Description: provides a customized template for the Participant Log display
*/
/**
* demonstrates how to provide a custom template for a Participant Log display
*
* @package WordPress
@xnau
xnau / pdb-record-edit-log.php
Last active March 13, 2022 19:48
Shows how to add an email template tag that shows all the changes made on a Participants Database record update.
<?php
/**
* Plugin Name: PDB Record Edit Log Tag
* Description: provides a custom email tag that shows which fields were updated
* Version: 1.0
*
*/
class PDb_Record_Edit_Log_Tag {
@xnau
xnau / pdb-custom-summary-tag.php
Created February 26, 2022 20:46
Sows how to add a custom summary tag to a Participants Database log
<?php
/**
* Plugin Name: PDB Custom Summary Tag
* Description: provides a custom tag to the "cars" log
*/
add_filter( 'pdblog-summary_tags', 'xnau_add_custom_summary_tag', 10, 2 );
/**
* adds a custom summary tag to the "cars" log
@xnau
xnau / pdb-admin-show-heading.php
Created February 14, 2022 18:39
Shows how to enable showing heading fields in the Participants Database admin edit participant page
<?php
/**
* Plugin Name: PDB Show Heading Fields in Admin
* Description: enabled showing the heading type field on the admin edit participant page
*/
add_filter( 'pdb-omit_backend_edit_form_element_type', 'xnau_enable_heading_field_display' );
/**
* remove the heading field from the backend omit types array
@xnau
xnau / pdb-custom-calc-field.php
Last active February 28, 2022 18:41
Shows how to set up a custom calculation for a Participants Database calculated field
<?php
/**
* Plugin Name: PDB Custom Calculated Field
* Description: demonstrates how to implement a custom calculation for a calculated field
*/
add_filter( 'pdb-calculated_field_calc_value', 'pdb_calculate_value', 10, 3 );
/**
@xnau
xnau / pdb-list-multisearch-edit-link.php
Created January 13, 2022 03:06
Shows how to combine the edit link template with a multisearch template for the Participants Database Combo Multisearch Plugin