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 | |
/* | |
Adding First and Last Name to Checkout Form | |
*/ | |
//add the fields to the form | |
function my_pmpro_checkout_after_password() | |
{ | |
if(!empty($_REQUEST['firstname'])) | |
$firstname = $_REQUEST['firstname']; |
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
/* | |
Disable the membership level dropdown in the admin if the user has a subscription at the gateway. | |
This will keep admins from accidentally cancelling subscriptions. | |
Note: Requires PMPro version 1.3.7+ | |
*/ | |
function my_pmpro_profile_show_membership_level($show, $user) | |
{ | |
global $wpdb; | |
//if the user's membership level is attached to a gateway, disable this field | |
$last_invoice = new MemberOrder(); |
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
/* | |
Functions to give access to certain pages within a timeframe. | |
Set the $pages and $levels arrays. | |
*/ | |
function my_pmpro_has_membership_access_filter($hasaccess, $mypost, $myuser, $post_membership_levels) | |
{ | |
$pages = array(214); // page ids | |
$levels[1] = array("2012-01-01", "2012-04-01"); // $level[level_id] = array(start_date, end_date); | |
$levels[2] = array("2012-02-01", "2012-05-01"); // date format is YYYY-MM-DD |
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 Name: Buy | |
*/ | |
/* | |
To make a checkout template for your site and PMPro. | |
1. Create a template page based on your page.php, single,php, index.php, etc. | |
2. Find the area where the post_content usually goes. |
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 | |
/* | |
Some WordPress HTTPS Fixes | |
In general, if you are using Paid Memberships Pro, you do not want to use the WordPress HTTPS plugin. PMPro will also secure your links. | |
If you are still receiving SSL errors on your checkout page, try setting the "nuclear" option on the Payment Gateway and SSL settings page of PMPro (v 1.3.19+) | |
If you want to continue using WordPress HTTPS for some reason, add this code to your theme's functions.php or somewhere else to force Paid Memberships Pro | |
to follow WordPress HTTPS' rules for redirecting, etc. | |
*/ | |
//if WordPress HTTPS is activated allow their force_ssl custom field to replace the besecure one | |
function pmpro_WordPressHTTPSForceSSL($besecure) |
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
/* | |
Requires PMPro v1.4+ | |
Code to delete WP user accounts when a member cancels their PMPro account. | |
Users are not deleted if: | |
(1) They are not cancelling their membership (i.e. $level_id != 0) | |
(2) They are an admin. | |
(3) The level change was initiated from the WP Admin Dashboard | |
(e.g. when an admin changes a user's level via the edit user's page) | |
*/ | |
function my_pmpro_after_change_membership_level($level_id, $user_id) |
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 | |
/* | |
Limiting posts per user. | |
Enable the Paid Memberships Pro plugin and then add this code to your functions.php or as a stand alone plugin. | |
Be sure to read through this code carefully. Update each function to suit your needs. | |
This code has not been tested. Feel free to post issues in the comments. | |
*/ | |
//increment post limit when checking out | |
function my_pmpro_after_checkout($user_id) | |
{ |
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 | |
/* | |
In Paid Memberships Pro v1.4+ the memberhsip level description is shown on the checkout page. This code will remove the description on the checkout page. | |
*/ | |
function my_pmpro_remove_description_from_checkout_page($level) | |
{ | |
$level->description = ""; | |
return $level; | |
} | |
add_filter("pmpro_checkout_level", "my_pmpro_remove_description_from_checkout_page"); |
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 this into a custom plugin or your active theme's functions.php | |
*/ | |
add_filter("pmpro_besecure", "__return_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 | |
/* | |
Plugin Name: PMPro Hidden Levels | |
Plugin URI: http://www.paidmembershipspro.com/pmpro-hidden-levels/ | |
Description: With this plugin, select levels are removed from the levels page but still available for checkout if you visit the checkout URL directly. | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ |
OlderNewer