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
/* | |
Only posts of type post in the RSS feed. | |
*/ | |
function my_pre_get_posts_filter_rss($query) { | |
if ($query->is_feed) { | |
$query->set('post_type', 'post'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','my_pre_get_posts_filter_rss'); |
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
/* | |
Change the text "Membership" to "Package" whever it appears in PMPro. | |
Add this code to a custom plugin. | |
*/ | |
function my_gettext_membership_to_package( $translated_text, $text, $domain ) | |
{ | |
if($domain == "pmpro" || $domain == "paid-memberships-pro") { | |
$translated_text = str_replace('Membership', 'Package', $translated_text); | |
$translated_text = str_replace('membership', 'package', $translated_text); |
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 this code into a custom plugin. Combine this with the pmpro-set-expiration-date and/or pmpro-subscription-delay plugins | |
to have memberships expire/renew on the same date, e.g. Y2-01-01 to expire/renew on Jan 1 next year. | |
You can update the logic to check for different months or adjust the price in a different way. The code below divides the | |
initial payment by 2 July 1 through Dec 31. | |
*/ | |
function pmpro_checkout_level_half_off_mid_year($level) { | |
$month = date('n', current_time('timestamp'); |
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
add_filter('pmpro_send_expiration_warning_email', '__return_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 | |
/* | |
Plugin Name: PMPro Customizations | |
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for my Paid Memberships Pro Setup | |
Version: .1 | |
Author: Paid Memberships Pro | |
Author URI: https://www.paidmembershipspro.com | |
*/ |
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: PMPro Customizations | |
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for my Paid Memberships Pro Setup | |
Version: .1 | |
Author: Paid Memberships Pro | |
Author URI: https://www.paidmembershipspro.com | |
*/ |
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
# BEGIN REDIRECT OLD PAYFAST ITN URL | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^wp-content/plugin/paid-membership-pro/services/payfast_itn_handler.php$ /wp-admin/admin-ajax.php?action=pmpro_payfast_itn_handler [L] | |
# END REDIRECT OLD PAYFAST ITN URL |
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
//this check will fail if $user->user_email is not set already | |
//it usese a PHP "magic method" to fetch the value, but | |
//the empty check will return true instead of actually | |
//checking the value | |
if ( empty( $user->user_email ) ) //in a lot of cases $user->user_email is always empty, even if the user has email address | |
return; | |
//this check will work no matter what | |
$email = $user->user_email; |
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
/* | |
Add SSL Seal to PMPro Checkout Page | |
Add this code to a custom plugin or your active theme's functions.php. | |
Custom code is necessary for this now that PMPro 1.9.3 for security reasons | |
doesn't allow script tags in the SSL Seal setting text area. | |
The example below is for an AlphaSSL certificate. Replace the $seal string below with | |
your own seals code. Be careful if the seal has single quotes in it. |
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
/** | |
* Have PMPro treat info notices like posts with regards to protecting by category | |
* Add this code to a custom plugin. | |
* #pmpro #notices | |
*/ | |
function pmpro_membership_access_post_info_notice($post) { | |
if($post->post_type == 'info-notice') | |
$post->post_type = 'post'; | |
return $post; |