Skip to content

Instantly share code, notes, and snippets.

Avatar

Roland Barker xnau

View GitHub Profile
@xnau
xnau / pdb-generate-member-id.php
Last active Jul 22, 2022
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-with-selected-send-signup-email.php
Created Jul 20, 2022
Tests adding the "send signup" item to the Participants Database With Selected admin list function
View pdb-with-selected-send-signup-email.php
<?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 Jul 19, 2022
Demonstrates how to define a custom template component set for the Participant Log add-on
View pdb_custom_log_template.php
<?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-populate-chosen-selector.php
Last active Mar 30, 2022
Demonstrates how to load a "Chosen" dropdown with options in Participants Database
View pdb-populate-chosen-selector.php
<?php
/**
* Plugin Name: PDB Populate Chosen Dropdown
* Description: tests loading a chosen element with options
*
* sets our function to be called when the pdbcde-before_element_rendered action
* is triggered by the form just before the "Chosen Dropdown" is shown so we can
* change the list of options to show
*/
@xnau
xnau / pdb-iframe-element.php
Last active Mar 20, 2022
Demonstrates how to create a Participants Database form element that displays an iframe
View pdb-iframe-element.php
<?php
/**
* Plugin Name: PDB Iframe Form Element
* Description: Demonstrates how to create a Participants Database form element that displays an iframe
*
*/
add_filter( 'pdb-set_form_element_types', 'pdb_iframe_register_element' );
add_action( 'pdb-form_element_build_iframe','pdb_iframe_element_building_function');
add_filter( 'pdb-before_display_form_element','pdb_iframe_element_value_display_function', 10, 2);
@xnau
xnau / pdb-record-edit-log.php
Last active Mar 13, 2022
Shows how to add an email template tag that shows all the changes made on a Participants Database record update.
View pdb-record-edit-log.php
<?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-calc-field.php
Last active Feb 28, 2022
Shows how to set up a custom calculation for a Participants Database calculated field
View pdb-custom-calc-field.php
<?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-custom-summary-tag.php
Created Feb 26, 2022
Sows how to add a custom summary tag to a Participants Database log
View pdb-custom-summary-tag.php
<?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 Feb 14, 2022
Shows how to enable showing heading fields in the Participants Database admin edit participant page
View pdb-admin-show-heading.php
<?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_form_elment_example.php
Last active Feb 10, 2022
example of creating a Participants Database Custom Form Element
View pdb_custom_form_elment_example.php
<?php
/**
* Plugin Name: PDB Array Form Element
* Description: a demonstration of the basic technique for creating a custom form element in Participants Database
*
*/
add_filter( 'pdb-set_form_element_types', 'my_array_register_element' );
add_action( 'pdb-form_element_build_array','my_array_element_building_function' );
add_filter( 'pdb-before_display_form_element','my_array_element_value_display_function', 10, 2 );