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 | |
/** | |
* Custom membership-card template | |
* Place this directly in your theme/child-theme's root directory | |
* e.g.: example.com/wp-content/themes/{your active theme}/membership-card.php | |
* | |
* Use the function my_pmpro_member_card_usermeta to retrieve meta values from the usermeta table | |
* | |
*/ |
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 | |
function my_login_redirect( $redirect, $request, $user ) { | |
if ( ! empty( $request ) ) { | |
remove_filter('login_redirect', 'pmpromh_login_redirect', 10, 3); | |
remove_filter('login_redirect','pmpro_login_redirect', 10, 3); | |
return $redirect; | |
} | |
} | |
add_action( 'login_redirect', 'my_login_redirect', 5, 3 ); |
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 | |
// Attachments fix for Email Log plugin. | |
function my_pmpro_email_attachments( $attachments, $email ) { | |
if ( null === $attachments ) { | |
return array(); | |
} | |
return $attachments; | |
} | |
add_filter( 'pmpro_email_attachments', 'my_pmpro_email_attachments', 10, 2 ); |
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 "authorizenet" to valid gateways. | |
function my_pmpro_valid_gateways( $gateways ) { | |
global $gateway, $pmpro_valid_gateways; | |
$gateways[] = 'authorizenet'; | |
$pmpro_valid_gateways = $gateways; | |
return $gateways; | |
} | |
add_filter( 'pmpro_valid_gateways', 'my_pmpro_valid_gateways' ); |
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 | |
/** | |
* Redirect PMPro related webhooks to PMPro webhook handler. | |
*/ | |
function my_woocommerce_api_request_redirect_pmpro( $request ) { | |
global $wpdb; | |
// Only continue if PMPro is loaded. |
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 | |
/** | |
* Disable membership unless users have agreed to Terms of Service (requires Register Helper). | |
* | |
* - Adds a ToS checkbox and link to the user's profile page. | |
* - Overrides membership if users haven't agreed to updated ToS. | |
* - Filters non-member text if users haven't agreed to ToS. | |
* - Resets ToS user meta when ToS page is updated. | |
*/ |
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 | |
/** | |
* Use most recent expiration date in Expired column in Members List. | |
*/ | |
function my_pmpro_memberslist_expires_column( $enddate, $user ) { | |
global $wpdb; | |
$filter = sanitize_text_field( $_REQUEST['l'] ); |
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 | |
function my_pmpro_states_init() { | |
add_filter( 'pmpro_state_dropdowns', '__return_true' ); | |
add_filter( 'pmpro_states', 'my_pmpro_states' ); | |
} | |
add_action( 'init', 'my_pmpro_states_init' ); | |
function my_pmpro_states( $states ) { |
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 | |
/** | |
* Fix for PMPro Proration Add On, Japanese Yen, and Stripe | |
*/ | |
function my_pmpro_checkout_level( $level ) { | |
// Make sure level costs are always integers. | |
$level->initial_payment = intval( $level->initial_payment ); | |
$level->billing_amount = intval( $level->billing_amount ); | |
return $level; |
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 | |
/** | |
* Simple Proration for Upgrades Example | |
*/ | |
function my_pmpro_checkout_level( $checkout_level ) { | |
// Get user's current level. | |
$user_level = pmpro_getMembershipLevelForUser(); | |
NewerOlder