Instantly share code, notes, and snippets.

View pdb-single-custom.php
<?php
/*
* template for displaying a business detailed view
*
* single record template
*/
// get the template object for this record
$this_business = new PDb_Template($this);
?>
<h1 class="business-title"
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' );
/**
View pdb-single-dual.php
<?php
/*
* shows a single record display based on a value in the record
*/
if ( $this->participant_id ) : ?>
<?php
switch ( $this->participant_values['type'] ) {
case 'player':
View pdb-list-multisearch-map.php
<?php
/*
*
* template for showing a Participants Database list with combo multisearch and a dynamic map
*/
$listmap = new pdbgmap\listmap($this);
global $PDb_Combo_Multi_Search;
$PDb_Combo_Multi_Search->enable();
$combo_search = $PDb_Combo_Multi_Search->get_text_search_value();
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
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 {
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
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:
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/
*
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