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
# BACKUP FIRST | |
# You generally do not want to setup PMPro levels | |
# with both a recurring billing amount AND | |
# an expiration date. | |
# This SQL query will clear the expiration date | |
# for active recurring memberships. | |
# BACKUP FIRST | |
UPDATE wp_pmpro_memberships_users | |
SET enddate = '0000-00-00 00:00:00' | |
WHERE status = 'active' |
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 a new column to the all pages view | |
function requires_membership_pages_columns_head( $defaults ) { | |
$defaults['requires_membership'] = 'Requires Membership'; | |
return $defaults; | |
} | |
//get the column data | |
function requires_membership_pages_columns_content( $column_name, $post_ID ) { | |
if ($column_name == 'requires_membership') { | |
global $membership_levels, $wpdb; |
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 a new column to the all posts view | |
function requires_membership_posts_columns_head( $defaults ) { | |
$defaults['requires_membership'] = 'Requires Membership'; | |
return $defaults; | |
} | |
//get the column data | |
function requires_membership_posts_columns_content( $column_name, $post_ID ) { | |
if ($column_name == 'requires_membership') { | |
global $membership_levels, $wpdb; |
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 a new column to the categories view | |
function requires_membership_categories_columns_head( $defaults ) { | |
$defaults['requires_membership'] = 'Requires Membership'; | |
return $defaults; | |
} | |
//get the column data | |
function requires_membership_categories_columns_content( $content, $column_name, $term_id ) { | |
if ($column_name == 'requires_membership') { |
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 | |
/* | |
Changes Report for Paid Memberships Pro | |
Title: pmpro_reports_changes | |
Slug: pmpro_reports_changes | |
*/ | |
//update this array for your desired reports. the format is: "report name" => array( initial_level_id, current_level_id ), | |
global $pmpro_reports_level_changes; | |
$pmpro_reports_level_changes = array( |
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 data from the wp_users, wp_user_meta, or BuddyPress xProfile fields tables to the Members List CSV Export. | |
The pmpro_members_list_csv_extra_columns passes an array of columns. | |
The keys of the array are the column headings. The values are callback functions to get the value for that row. | |
*/ | |
//add the column to the export | |
function my_pmpro_members_list_csv_extra_columns ( $columns ) { |
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
/* | |
Allow non-members to view restricted posts if they are less than 30 days old. | |
Add this code to a custom plugin. | |
Change the '-30 Days' below if you'd like to allow access for longer or shorter. | |
*/ | |
function open_new_posts_to_non_members($hasaccess, $thepost, $theuser, $post_membership_levels) | |
{ | |
global $wpdb; |
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 | |
/* | |
Set a maximum number of members allowed to register for a membership level. | |
Add this code to a plugin for PMPro Customizations. | |
Set the "Maximum" for a level on the Memberships > Membership Levels > Edit Level admin page. | |
*/ | |
function pmproml_pmpro_save_membership_level( $level_id) { | |
if( $level_id <= 0 ) { |
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
/* | |
Link discount codes to affiliates. | |
*/ | |
//this is the parameter we're looking for to find affiliates... based on which plugin/etc you are using | |
define('PMPRO_LDC2AFF_KEY', 'wpam_id'); //Affiliates Manager Plugin | |
//define('PMPRO_LDC2AFF_KEY', 'pa'); //WordPress Lightweight Affiliates | |
//define('PMPRO_LDC2AFF_KEY', 'ref'); //AffiliateWP | |
//helper function to get the values from options and make sure they are an array | |
function pmpro_ld2aff_getOptions() { |
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 | |
*/ | |
/* |