This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: PDB Set Paid Status Tutorial | |
* Version: 0.1 | |
* Description: Demonstrates how to set up a simple "with selected" action in the Participants Database admin record list. | |
* Author: Roland Barker, xnau webdesign https://xnau.com | |
* | |
*/ | |
/** | |
* defines our action and adds it to the dropdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// determine the range of dates to show | |
$start = date( 'M j,Y', strtotime( '-7 days' ) ); // the date 7 days ago | |
$end = date( 'M j,Y' ); // today's date | |
// now build the shortcode with the date range filter | |
echo do_shortcode( '[pdb_list filter="date_recorded>=' . $start . '&date_recorded<=' . $end . '" ]' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// determine the range of dates to show | |
$start = date( 'M 01,Y' ); // first day of the current month | |
$end = date( 'M t,Y' ); // last day of the current month | |
// now build the shortcode with the date range filter | |
echo do_shortcode( '[pdb_list filter="date_recorded>=' . $start . '&date_recorded<=' . $end . '" ]' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Participants Database Set Private ID Length | |
* Description: sets a custom length for the private ID | |
*/ | |
// set the private ID length to 9 | |
add_filter( 'pdb-private_id_length', function ( $length ) { return 9; } ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* bootstrap template for signup form | |
* | |
* this demonstrates how to set the default value of a field in the template | |
* | |
* outputs a Twitter Bootstrap-compatible form | |
* http://twitter.github.com/bootstrap/index.html | |
* | |
* @version 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
template for participants list shortcode output | |
this template demonstrates a "table-less" reponsive layout for the list of records | |
using the PDb_Template class for each record | |
*/ | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* template for participants list shortcode output with adetail link on several fields | |
* | |
*/ | |
// define an array of field names to place the detail link on | |
$detail_link_fields = array( 'first_name','last_name','photo' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Participants Database Show Participant's Age | |
* Description: Sets up a field that shows a person's age | |
* Version: 2.0 | |
*/ | |
class pdb_set_age_value { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: PDB Multiple Field Match Check | |
* Description: checks a new Participants Database submission against | |
* the database for a matching record using multiple fields | |
* Version: 1.2 | |
*/ | |
add_filter( 'pdb-incoming_record_match', 'xnau_check_for_match', 10, 2 ); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |