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-record-delete-switch.php
Last active Aug 25, 2018
Shows how to set up a switch where a user can delete their own record
View pdb-record-delete-switch.php
<?php
/**
* Plugin Name: PDB Record Delete Switch
* Description: Gives users the ability to delete their own record
*/
class PDb_Record_Delete_Switch {
/**
* @var string name of the delete field
@xnau
xnau / pdb-list-grid.css
Last active Jun 27, 2018
CSS for setting up a grid layout using the Participants Database responsive list display
View pdb-list-grid.css
/*
Stylesheet for setting up a CSS grid layout for the
Participants Database responsive list display
*/
/* this is to hide unneeded elements */
.pdb-list-grid .pdb-field-title,
.pdb-list-grid h5 {
@xnau
xnau / pdb-auto-unapprove.php
Created Jun 25, 2018
Demonstrates how to automatically "unapprove" a record in Participants Database when the user makes changes.
View pdb-auto-unapprove.php
<?php
/**
* Plugin Name: PDB Auto Unapprove
* Description: sets the record approval field to "no" when the user edites their record
*/
add_action( 'pdb-after_submit_update', 'xnau_auto_unapprove' );
/**
* sets the approval field to "no" when a user updates their record
*
* @param array $post the posted data
@xnau
xnau / pdb-single-opengraph.php
Last active Jul 18, 2018
Shows how to set up a template for including meta tags in a Participants Database singe record page when using the Image Expansion add-on
View pdb-single-opengraph.php
<?php
/**
* @name pdb single opengraph template
* @version 0.1
*
* template for printing opengraph meta tags
*
* this variant is for use with the Participants Database Image Expansion add-on
*
* simplified information on using social media meta tags can be found here:
@xnau
xnau / pdb-single-opengraph.php
Last active Jun 17, 2018
Shows how to set up a custom Participants Database template that only prints opengraph meta tags
View pdb-single-opengraph.php
<?php
/**
* @name pdb single opengraph template
* @version 0.1
*
* template for printing opengraph meta tags
*
* simplified information on using social media meta tags can be found here:
* https://css-tricks.com/essential-meta-tags-social-media/
*
@xnau
xnau / pdb-opengraph-headers.php
Last active Jun 15, 2018
Demonstrates how to place OpenGraph meta data into a Participants Database single record display page.
View pdb-opengraph-headers.php
<?php
/**
* Plugin Name: PDB Add Facebook/Twitter Meta Tags
* Description: place metadata tags in the header of a single record page
*/
// this will fire just before the end of the page <head> tag
add_action( 'wp_head', 'xnau_place_opengraph_tags', 100 );
/**
* places the meta tags in the page head
@xnau
xnau / pdb-prevent-php-clock-sync.php
Last active Jun 3, 2018
shows how to disable Participants Database synchronizing the php timezone with the WordPress timezone
View pdb-prevent-php-clock-sync.php
<?php
/**
* Plugin Name: PDB Defeat Timezone Sync
* Description: disables Participants Database synchronizing the php timezone with the WordPress timezone
*/
add_filter( 'pdb-php_timezone_sync', function () { return false; } );
@xnau
xnau / pdb-custom-link-recovery.php
Created May 28, 2018
Shows how to send a Participants Database private link by matching 2 or more fields
View pdb-custom-link-recovery.php
@xnau
xnau / pdb-limit-signups.php
Last active May 22, 2018
Shows how to limit the number of Participants Database signups
View pdb-limit-signups.php
<?php
/**
* Plugin Name: PDB Limit Signups
* Description: Adds a count of the number of Participants Database signups, and prevents new signups
* once a number of registrations has been reached
*/
add_filter( 'pdb-signup_shortcode_output', 'xnau_limit_signups' );
/**
* adds a display of the number of signups and prevents signups once a limit is reached
*
@xnau
xnau / pdb-comma-decimal-display.php
Created May 18, 2018
Demonstrates how to show decimal numbers using comma as the separator
View pdb-comma-decimal-display.php
<?php
/**
* Plugin Name: PDB Comma Decimal Separator Display
* Description: alters the display of decimal numbers to use comma as the decimal separator, and point as the thousands separator
*/
add_filter('pdb-before_display_form_element', 'xnau_show_comma_decimals', 10, 2 );
function xnau_show_comma_decimals( $display, $field )
{
// we are only modifying these form element types
if ( $field->form_element === 'decimal' || $field->form_element === 'currency' ) {
You can’t perform that action at this time.