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 | |
/** | |
* Adjust the 'Join Now' link on the login page to a custom URL for Paid Memberships Pro. | |
* Follow this guide to add custom code to your membership site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_custom_join_now_link( $links, $allowed_html ) { | |
$links['register'] = '<a href="https://example.com/join-now/">' . __( 'Join Now', 'paid-memberships-pro' ) . '</a>'; | |
return $links; | |
} | |
add_filter( 'pmpro_login_forms_handler_nav', 'my_pmpro_custom_join_now_link', 10, 2 ); |
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 // Do Not Copy This Line | |
/** | |
* This recipe will help you change text on the checkout paid by level | |
* You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// paste content from below this line |
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 | |
/** | |
* Display the last visited non-PMPro page in the confirmation message, OR | |
* redirect the member back to the last visited page. | |
* | |
* Usage Guide: | |
* | |
* 1. Set your preference to either display the link or redirect back to | |
* the referrer page by setting the $toggle_display_redirect variable | |
* to true or false. |
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 | |
/** | |
* Custom order codes for Paid Memberships Pro Orders. | |
* | |
* This code will take the date and order ID and create | |
* an order code from that such as "INV060920211", "INV060920212", "INV060920213" | |
* and increment with each order added. | |
* | |
* A fallback is in place that if "INV060920211" already exists for some order, | |
* it will just generate a random code to be safe. |
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 &pmpro_reset_analytics=1 to your WordPress dashboard URL/Paid Memberships Pro reports page. | |
* Add this code to your Code Snippets / Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* You may remove this code from your site when you don't need it any longer. | |
*/ | |
function my_pmpro_reset_visit_data() { | |
// Check if URL parameter pmpro_reset_analytics is set | |
if ( isset( $_REQUEST['pmpro_reset_analytics'] ) ) { |
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 | |
/** | |
* This recipe will restrict all pages except Paid Memberships Pro pages, | |
* or the home page of your website, the search results page, the 404 page, or defined post/pages to non-members, | |
* non-approved members, or logged-out users. | |
* | |
* This won't affect administrators. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. |
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 Display Name on Membership Checkout and for BuddyPress Name field. | |
*/ | |
function my_first_last_display_name( $user_id, $morder ) { | |
// Get user's first and last name. | |
$first_name = get_user_meta( $user_id, 'first_name', true ); | |
$last_name = get_user_meta( $user_id, 'last_name', 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 | |
/* | |
* Allow members to upload their avatar using a Register Helper field during checkout or on the Member Profile Edit page. | |
* | |
* Requires: Paid Memberships Pro, Register Helper Add On. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 | |
/** | |
* This recipe will search your codebase for | |
* translatable strings and replace when an exact match is found. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
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 | |
/** | |
* Show the user's expiration date, or their next payment date. | |
* [show_enddate] ( show end date, show enddate, show_endate ) | |
* Show the user's previously expired date if they were cancelled, expired or cancelled by an admin. | |
* If none of thhe above is found, the string 'nothing found' will be returned. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. |
NewerOlder