This file contains hidden or 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 | |
/** | |
* Look up the label of an option for a Register Helper field. | |
* @param $field_name The name of the field (user meta key) | |
* @param $option_key The key of the option in the fields options array. | |
* @returns The label for the field or "N/A" if none found. | |
*/ | |
function my_get_rh_option_label( $field_name, $option_key ) { | |
global $pmprorh_registration_fields; | |
This file contains hidden or 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
/** | |
* Sort BuddyPress members by PMPro membership level. | |
* Add this code as a code snippet or in a custom plugin. | |
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
*/ | |
function my_sort_bp_members_list( $query ) { | |
global $wpdb; | |
$query->uid_clauses['select'] .= " LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.user_id = mu.user_id AND mu.status = 'active' "; | |
$query->uid_clauses['orderby'] = str_replace( 'ORDER BY', 'ORDER BY mu.membership_id DESC, ', $query->uid_clauses['orderby'] ); | |
} |
This file contains hidden or 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 | |
/** | |
* Change the billing amount and cycle number/period for a user's active membership. | |
* This is useful if the number is out of alignment with the gateway. | |
* Change the variables under "change this stuff" | |
* Then visit /wp-admin/?my_fix_billing_amount=1 as an admin. | |
* Deactivate this snippet after running. | |
*/ | |
function my_fix_billing_amount() { | |
global $wpdb; |
This file contains hidden or 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 | |
/** | |
* When PMPro users cancel or expire, they are shown on the | |
* cancelled, expired, and "old" members lists. | |
* However, if an old user is given a default/free level later, | |
* then they are not considered old, cancelled, or expired anymore. | |
* | |
* You may still want to see those users on the old users lists | |
* so you can follow up to get them back into paid accounts. | |
* This code does that. |
This file contains hidden or 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
add_filter( 'pmpro_roles_exclude_other_pmpro_roles', '__return_false' ); |
This file contains hidden or 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
/** | |
* Change the "IMPORTANT!" confirmation text when using PMPro and the Email Confirmation Add On. | |
* Add this code into a custom plugin or code snippet. | |
* Be sure to change the translated lines below to the language and words you want. | |
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
*/ | |
function my_pmpro_email_confirmation_text( $translated_text, $text, $domain ) { | |
// Ignore strings for other plugins. | |
if ( $domain != 'pmpro-email-confirmation' ) { | |
return $translated_text; |
This file contains hidden or 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
/** | |
* Include this code in your custom WordPress plugin | |
* to load your own versions of the PMPro page templates. | |
* To override the cancel.php template, place your own | |
* cancel.php template in a folder like this: | |
* ../plugins/yourpluginslug/templates/cancel.php | |
* | |
* Using priority 100 will make sure this runs after | |
* other code using the smae hook. For example, | |
* it will run later than the Reason for Cancelling Add On |
This file contains hidden or 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 this function into a customizations plugin | |
* and then visit yoursite.com/wp-admin/?test_braintree_webhook=1 from a browser. | |
*/ | |
function init_test_braintree_webhook() { | |
if(!empty($_REQUEST['test_braintree_webhook'])) { | |
define('PMPRO_BRAINTREE_WEBHOOK_DEBUG', true); | |
$_POST['bt_signature'] = 'putthesignaturefromthewebhookloghere'; |
This file contains hidden or 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: Paid Memberships Pro - Australia GST | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/ | |
Description: Apply Australia GST to Checkouts with PMPro | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
/* |
This file contains hidden or 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 | |
/** | |
* Display a member's badge on replies. | |
* Requires the Member Badge Add On https://www.paidmembershipspro.com/add-ons/member-badges/ | |
* Add this code to a Code Snippet or custom plugin. | |
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
*/ | |
function my_show_member_badge_in_bbpress_replies() { | |
// Make sure pmpro and bbpress are active. | |
if ( ! defined( 'PMPRO_VERSION' ) || ! class_exists( 'bbPress' ) ) { |