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 | |
/** | |
* Remove CVV from the checkout page and don't require it. | |
*/ | |
// Removes the field from the checkout page. | |
function my_pmpro_show_cvv( $show ) { | |
return false; | |
} | |
add_filter( 'pmpro_show_cvv', 'my_pmpro_show_cvv' ); |
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 | |
/** | |
* Add a "member_number" field that only admins can edit. | |
* Make sure PMPro and the Register Helper Add On are active. | |
* Copy this code into a Code Snippet or custom plugin. | |
*/ | |
function my_pmpro_member_number_field() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; |
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 | |
/** | |
* Based on the Register Helper example. | |
* We've added a "buddypress" option for each field | |
* set to the XProfile name we used when setting up | |
* the fields in the BuddyPress extended profile. | |
* If the PMPro BuddyPress Add On is activated | |
* then the fields will be synchronized. | |
* Register Helper: https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
* PMPro BuddyPress: https://www.paidmembershipspro.com/add-ons/buddypress-integration/ |
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 | |
/** | |
* Change the default PMPro WooCommerce bahavior | |
* and make membership products not purchasable | |
* if a user already has any other membership level. | |
*/ | |
// First disable the core PMPro WC callaback and set up our own. | |
function my_pmprowoo_init() { | |
remove_filter( 'woocommerce_is_purchasable', 'pmprowoo_is_purchasable', 10, 2 ); | |
add_filter( 'woocommerce_is_purchasable', 'my_pmprowoo_is_purchasable', 5, 2 ); |
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 | |
/** | |
* Make sure to add the wpe-login parameter to the lostpassword URL. | |
*/ | |
function my_fix_wpelogin( $url ) { | |
$url = add_query_arg( 'wpe-login', true, $url ); | |
return $url; | |
} | |
add_filter( 'lostpassword_url', 'my_fix_wpelogin' ); |
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 | |
/** | |
* Assign additional membership levels based on fields at checkout. | |
* Requires PMPro, PMPro MMPU, and PMPro Register Helper. | |
* This is just an example. Be sure to change the field settings, | |
* field meta name, and membership levels to fit your needs. | |
*/ | |
// Add a checkbox via Register Helper | |
function my_amlbofat_add_fields() { |
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 | |
// Add this to your wp-config.php file. | |
define('PMPRO_LICENSE_NAG', false); |
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
span.pmpro_asterisk:after { content: "Required" } |
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 | |
/** | |
* Restrict files in the media library based on media category. | |
* Required plugins: | |
* - Paid Memberships Pro | |
* - Media Library Categories | |
* Must have PMPro set up to run files through the getfile.php script. | |
* See this post: https://www.paidmembershipspro.com/locking-down-protecting-files-with-pmpro/ | |
* Add a 'members' category or adjust the code below to use your categories. | |
*/ |