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 specific members-only categories back to main loop | |
* when filtering searches and archives. | |
* Updated for PMPro 3.0+. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 | |
/** | |
* Require specific category user meta to view posts in designated categories. | |
* Custom price-adjusting fields are added via user fields. | |
* The initial payment and billing amount is adjusted based on cat selections. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* This will add billing fields to Add Member and the user's profile page. | |
*/ | |
function add_billing_fields_to_add_member_profile() { | |
//check for register helper | |
if(!function_exists("pmpro_add_user_field")) // pmprorh_add_registration_field | |
return; |
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 | |
/** | |
* Automatically approve any previously approved member. | |
* Requires the PMPro Approval Process for Membership Add On - https://www.paidmembershipspro.com/add-ons/approval-process-membership/ | |
* Add this code to your site following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_automatically_approve_previously_approved( $level_id, $user_id, $cancelled_level ) { | |
if ( ! class_exists( 'PMPro_Approvals' ) ) { |
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
/** | |
* Prorate the initial payment at PMPro checkout based on the day of the month. | |
* You should use the Subscription Delays add on to set your subscription | |
* to delay until Y1-M1-01. | |
*/ | |
function my_pmpro_checkout_level( $level ) { | |
$current_day = date( 'j' ); | |
// Ignore if it's the first of the month. | |
if ( $current_day == 1 ) { |
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
# successful paid orders for a given month | |
SELECT COUNT( * ) | |
FROM wp_pmpro_membership_orders | |
WHERE | |
total > 0 AND | |
status NOT IN ( | |
'error', 'token', 'refunded', 'pending', 'review' | |
) | |
AND TIMESTAMP > '2017-10-01' | |
AND TIMESTAMP < '2017-11-01'; |
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 | |
/** | |
* This filter will search your codebase for translatable strings and replace when an exact match is found. | |
* | |
* Here we're changing 'Membership' to 'Subscription' for Paid Memberships Pro. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above. | |
* |
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 | |
/** | |
* Allow other business email addresses for PMPro IPN Messages. | |
* To add this code to your site you may follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_ipn_check_receiver_email($check, $email) { | |
if ( in_array( '[email protected]', $email ) ) { //change email here to the old email | |
$check = true; | |
} |
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 | |
/** | |
* If a user checked option1, then add $100 to the price. | |
*/ | |
function my_pmpro_checkout_level($level) { | |
if( ! empty( $_REQUEST['option1'] ) || ! empty( $_SESSION['option1'] ) ) { | |
$level->initial_payment = $level->initial_payment + 100; | |
//$level->billing_amount = $level->billing_amount + 100; //to update recurring payments too | |
} |
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: 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 | |
*/ | |
/* |
NewerOlder