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 Default Date | |
* Description: sets the default date for a specific date field | |
*/ | |
add_action( 'pdb-before_display_form_input', 'xnau_set_default_date' ); | |
/** |
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 | |
/** | |
* @version 0.1 | |
* | |
* this template shows how to add a link to the single record in a global log list | |
* | |
*/ | |
/** |
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 | |
/* | |
* shows how to add a record edit link to a global log list template | |
* | |
*/ | |
/** | |
* provides the record's edit link | |
* | |
* @global wpdb $wpdb |
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 | |
/** | |
* | |
* signup form that limits the number of signups | |
* | |
*/ | |
// set the maximum number of signups | |
$limit = 100; |
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 | |
$record = new PDb_Template( $this ); | |
// name of the field you're interested in | |
$field = 'interests'; | |
// get the array of defined options | |
$option_list = $record->get_field_prop( $field, 'options' ); | |
// assume the title is blank at first |
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 | |
/** | |
* shows a WP user profile edit form with Participants Database fields in a tabbed interface | |
* | |
*/ | |
global $PDb_WP_Users, $PDb_Frontend_Profile, $post, $wp; | |
/** @var \pdbwpu\Plugin $PDb_WP_Users */ | |
/** @var \pdbwpu\Frontend_Profile $PDb_Frontend_Profile */ | |
$profileuser = $PDb_Frontend_Profile->this_user(); |
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 Record Page Title | |
* Description: uses data from a Participants Database record to set the page title | |
* | |
* This plugin uses one or more fields from a participants database record to set | |
* the title of the page. | |
*/ | |
class pdb_record_page_title { |
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 HTML Email Wrapper | |
* Description: Adds a structural HTML wrapper to outgoing Participants Database emails. | |
*/ | |
class pdb_email_html_wrapper { | |
/** | |
* |
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 Shortcode Placement Notification | |
* Description: Tells the Participants Database plugin that a shortcode is present on the page. | |
*/ | |
add_filter( 'pdb-shortcode_in_content', 'xnau_notify_shortcode_present', 10, 2 ); | |
/** | |
* tells the plugin that a shortcode is present | |
* |
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
// check for a specific post ID, then fire the action if it matches | |
add_action( 'wp', function () { | |
global $post; | |
if ( $post->ID == 9627 ) { | |
do_action( 'pdb-shortcode_present'); | |
} | |
}); |