Skip to content

Instantly share code, notes, and snippets.

View MaryOJob's full-sized avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@ipokkel
ipokkel / pmpro-reveal-password.php
Last active June 26, 2024 13:49
Toggle the password visibility on PMPro Checkout, Login, and Signup Shortcode pages by clicking on the Dashicon eye icon to reveal or hide the password.
<?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
@ipokkel
ipokkel / email-custom-membership-expired-template-per-level.php
Last active January 26, 2023 13:01
Send a custom PMPro membership expired email per membership level.
<?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.
@MaryOJob
MaryOJob / pmpro-limited-time-registration.php
Created March 11, 2022 18:11 — forked from JarrydLong/pmpro-limited-time-registration.php
Restrict a membership level to no longer allow sign ups after a given date (limited time offer) using Paid Memberships pro
<?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
@ipokkel
ipokkel / no-oembed-pmpromd-pages.php
Created March 4, 2022 08:21
Prevent oembeds from running on the PMPro Member Directory Add On pages.
<?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
@ipokkel
ipokkel / pmpro-bbpress-redirect-forum-archive-page.php
Created February 23, 2022 10:54
Redirect non-members from bbPress forums page. #pmpro #bbpress
<?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/
@andrewlimaza
andrewlimaza / pmpro-approvals-delete-deny.php
Created February 18, 2022 14:31
Delete User on PMPro Approvals Deny. Delete denied user.
<?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 );
@dparker1005
dparker1005 / stripe_customer_portal.php
Last active October 4, 2024 18:45
Have users update their billing information in Stripe Customer Portal.
<?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)
@ipokkel
ipokkel / exclude-levels-from-recurring-payment-reminder-email.php
Last active September 6, 2024 08:46
Don't send recurring payment email reminder to specified levels.
<?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.
<? 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 ) {
@kimcoleman
kimcoleman / pmpro-columns-grid-payment-method-select-checkout.css
Created January 28, 2022 17:11
Custom CSS for Membership Checkout page with Payment Method Select using CSS Grid: 2 Column Layout for "Account Information" and "Billing Information" sections.
.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"