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
RewriteBase / | |
RewriteRule ^wp-content/uploads/(.*\.pdf)$ /wp-content/plugins/paid-memberships-pro/services/getfile.php [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
define('PMPRO_GETFILE_ENABLED', true); |
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
RewriteBase / | |
RewriteRule ^wp-content/uploads/(.*)$ /wp-content/plugins/paid-memberships-pro/services/getfile.php [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
RewriteBase / | |
RewriteRule ^wp-content/uploads/.*(\.pdf|\.doc|\.docx|\.ppt|\.zip)$ /wp-content/plugins/paid-memberships-pro/services/getfile.php [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
/** | |
* Change PMPro to only track visits for logged in users. | |
* Add this code into a custom plugin or code snippet. | |
*/ | |
function my_pmpro_report_login_wp_visits_only_for_users() { | |
if ( ! is_user_logged_in() ) { | |
remove_action( 'wp', 'pmpro_report_login_wp_visits' ); | |
} | |
} | |
add_action( 'init', 'my_pmpro_report_login_wp_visits_only_for_users' ); |
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
/** | |
* Allow meta filtering of the membership directory | |
* if pk and ps params are passed into the URL. | |
* PMPro and the PMPro Member Directory Add Ons should be active. | |
* Then add this code to a custom plugin. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_add_meta_queries_to_pmpro_directory_search( $sql_parts ) { | |
global $wpdb; | |
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 directory template. Adds alphabetical last name query. For example you can use the URL: | |
http://www.example.com/membership-account/directory/?lt=A | |
if you want all the members with last names starting with 'A'. | |
Also includes meta key/value search. For example you can use the URL: | |
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 a default discount code for the PMPro checkout page. | |
* Change the DEFAULT code to the one you want to use. | |
* You could alter this to check the $pmpro_level global to | |
* do this only for certain levels. | |
* You could add other logic to exclude existing customers/etc. | |
* Add this code to a custom plugin or Code Snippet. | |
*/ | |
function my_default_pmpro_discount_code() { |
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
/** | |
* Update RH fields after they've been setup. | |
* The example below sets the addmember property to true. | |
* Add this code to a custom plugin or Code Snippet. | |
*/ | |
function my_update_rh_fields() { | |
global $pmprorh_registration_fields; | |
if ( empty( $pmprorh_registration_fields ) ) { | |
return; |
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
/** | |
* When a user is given a level, give add that user to another site | |
* in the network and give them a level there too. | |
* PMPro should be active on both blogs. | |
* The other blog should have the membership level already setup, note the ID. | |
* Blog/site IDs can be found in the Sites page of the network dashboard. | |
* This is not mean to work with the other PMPro multisite add ons. | |
* Add this to a custom plugin or as a Code Snippet on your site. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |