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 | |
/** | |
* Password visibility toggle with Dashicons. | |
* | |
* Adds an eye icon which on click reveals the password. | |
* This also works for the Signup Shortcode Add On. | |
* | |
* This code recipe assumes that the Dashicons library is already enqueued. | |
* | |
* You can add this recipe to your site by creating a custom plugin |
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 | |
/** | |
* This recipe sets a custom membership expired email template and subject line per level. | |
* | |
* In this example recipe we created a custom email template for level ID's 1 & 2 | |
* in the "email" folder inside our customization plugin's directory. | |
* | |
* Note: This recipe and the required email template folders need to be added | |
* to a custom plugin and will not work from a third-party plugin that adds | |
* php customization recipes to the site. |
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 | |
/* Checks to see if a registration is happening after a given date; if so, prevent registration and stop new signups for the level/no longer display the level on the levels page | |
*/ | |
global $pmproml_start_date, $pmproml_end_date, $pmproml_limited_level_id; | |
$pmproml_limited_level_id = array( 1, 2, 4 ); // change to the ID of the limited-time membership level | |
$pmproml_start_date = "2019/04/01"; // change to the date registration starts, in YYYY/MM/DD format | |
$pmproml_end_date = "2019/04/30"; // change to the date registration ends, in YYYY/MM/DD format |
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 | |
/** | |
* Prevent oembeds from running on the PMPro Member Directory Add On pages. | |
* | |
* This may be helpful if any external or social URLs are listed on the directory | |
* or profile page. | |
* | |
* Can clear oembed cache with steps here: https://siteorigin.com/clearing-oembed-cache/ | |
* | |
* You can add this recipe to your site by creating a custom plugin |
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 | |
/** | |
* Redirects all non-members from the forums page. | |
* | |
* This recipe requires bbPress and Paid Memberships Pro plugins. | |
* | |
* 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 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 | |
/** | |
* Automatically delete user when their approval is denied. | |
* Add this code to your site by following: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_approvals_delete_member_on_deny( $user_id, $level_id ) { | |
wp_delete_user( $user_id ); | |
} | |
add_action( 'pmpro_approvals_after_deny_member', 'pmpro_approvals_delete_member_on_deny', 10, 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 | |
// Copy from below here... | |
/** | |
* Have users update their billing information in Stripe Customer Portal. | |
* | |
* NOTE: Before using Stripe Customer Portal, you must first enable it by saving the | |
* customer portal settings page here: | |
* https://dashboard.stripe.com/settings/billing/portal (For live mode) |
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 | |
/** | |
* Do not sent recurring payment reminder email to specified levels. | |
* | |
* This may be useful to stop sending reminder emails for short | |
* billing term recurring payment membership levels. | |
* | |
* 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. |
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 post access to specific user IDs or user Roles. | |
* | |
* 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/ | |
*/ | |
function restrict_specific_posts_to_specific_users( $hasaccess, $thepost, $theuser, $post_membership_levels ) { |
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
.pmpro-checkout .pmpro_form { | |
display: -ms-grid; | |
display: grid; | |
grid-column-gap: 1em; | |
-ms-grid-columns: 1 1em 1; | |
grid-template-columns: 1 1; | |
grid-template-areas: | |
"message message" | |
"pricing pricing" | |
"user address" |