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 | |
/** | |
* Change body text of email according to level checkout. | |
* Assumes level ID is 1. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_body( $body, $email ) { |
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 | |
/** | |
* Change all 'invoice' to 'tax invoice' | |
* Add this code to PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function theme_change_comment_field_names( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { |
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 | |
/** | |
* Removes the always redirect to member homepages. Only allows login redirect functionality. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function remove_memberhome_pages_redirect(){ | |
remove_action('template_redirect', 'pmpromh_template_redirect_homepage'); | |
} |
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 user does not have a membership level only offer flat rate. | |
* If is a Paid Memberships Pro, force free shipping! | |
* | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* | |
* PLEASE NOTE: Clear WooCommerce Transients for this to take affect if not working. |
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
function my_pmpro_valid_gateways( $gateways ) { | |
$gateways[] = "stripe"; | |
return $gateways; | |
} | |
add_filter( "pmpro_valid_gateways", "my_pmpro_valid_gateways" ); | |
function my_pmpro_checkout_boxes() { | |
?> | |
<a href="?level=<?php echo intval($_REQUEST['level']);?>&gateway=stripe">Checkout with Stripe</a> | |
<?php |
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 | |
/** | |
* Redirect all non-admin user's after they login to your website's home page. | |
* Documentation for login_redirect filter - https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect | |
* Visit https://yoohooplugins.com for more tutorials. | |
*/ | |
function yh_redirect_after_login( $redirect_to, $request, $user ) { | |
if ( isset( $user->roles ) && is_array( $user->roles ) ) { |
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 | |
/** | |
* Remove fields from certain levels for the Add Name To Checkout - https://www.paidmembershipspro.com/add-ons/add-first-last-name-to-checkout/ | |
* Add this to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function remove_name_from_fields() { | |
$levels_to_remove_fields_from = array( '1', '2', '3', '4', '5' ); //change the level ID's in this to hide the fields from this. |
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 to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
/* | |
Make any post older than 18 months available for free. | |
Add this code to your active theme's functions.php or a | |
custom plugin. | |
*/ |
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 temporary access to all restricted content for non-members until a certain date. | |
* Add this function below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_allow_temp_access_for_non_members($hasaccess, $mypost, $myuser, $post_membership_levels){ |