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 | |
add_action( 'pdbmps-status_change_to_past_due', 'xnau_unapprove_record', 10, 2 ); | |
function xnau_unapprove_record ( $status, $data ) | |
{ | |
// this is so we can access a function in the plugin | |
global $PDb_Member_Payments; | |
// now set the record to not approved (2nd argument) | |
$PDb_Member_Payments->approve_record( $data['id'], false ); | |
} |
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 | |
add_filter( 'pdb-access_capability', 'allow_editor_list_delete', 10, 2 ); | |
/** | |
* alters access privileges | |
* | |
* @see https://codex.wordpress.org/Roles_and_Capabilities | |
* | |
* @param string $cap current WP capability for the privilege | |
* @param string $context the privilege requested | |
* @return string the WP capability to use for the privilege |
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 search form | |
* | |
*/ | |
?> | |
<div class="wrap <?php echo $this->wrap_class ?>"> | |
<?php echo $this->search_error_style ?> | |
<div class="pdb-searchform"> |
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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: Set Decimal Datatype | |
* Description: set a custom datatype for a Participants Database decimal form element | |
*/ | |
add_filter( 'pdb-form_element_datatype', 'xnau_set_decimal_type', 10, 2 ); | |
/** | |
* sets the datatype for decimal fields | |
* |
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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: Unapprove Unpaid Records | |
* Description: unapproves the record if the account has not been paid | |
*/ | |
add_action( 'pdbmps-status_change_to_due', 'xnau_unapprove_unpaid_account' ); | |
/** | |
* unapproves the record if the payment lapses | |
* |
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 Sort By Month | |
* Description: Demonstrates how to set up an arbitrary list sort in Participants Database | |
*/ | |
/* | |
* Important: this assumes that the column you want to put the arbitrary sort on is already | |
* present in the sort as defined in the shortcode. For instance, in this example, the shortcode | |
* should have the sort set up like this: [pdb_list orderby="month" order="ASC"] then that sort | |
* gets replaced by the one we are setting up in this filter. |
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 | |
/* | |
* demonstrates a profile payment form where the payment is controlled by the member's payment status | |
*/ | |
?> | |
<div class="wrap <?php echo $this->wrap_class ?>"> | |
<?php | |
if ( !empty( $this->participant_id ) ) : | |
// output any validation errors |
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: Redirect PDB Login | |
Description: Alters the redirect according to a value in the user's record when using the PDB Login add-on | |
*/ | |
add_action( 'pdb-login_after_validate_submission', 'xnau_setup_pdb_login_redirect', 10, 2 ); | |
/** | |
* sets up the redirect filter | |
* | |
* this checks the newly-logged-in user's record and |
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 | |
* | |
* demonstrates how to control the display of some fields based on the value of another field | |
* | |
*/ | |
// these are the fields that we are controlling the display of |
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 | |
// place the filter on the posted data before it is submitted | |
add_filter( 'pdb-before_submit_signup', 'xnau_conditional_signup_redirect' ); | |
/** | |
* changes the signup form "thanks" page depending on a value in the form | |
* | |
* @param array $post the posted data | |
* @return array post data | |
*/ | |
function xnau_conditional_signup_redirect( $post ) |