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-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"
<?php //do not copy
/**
* This recipe will provide a basic implementation of the hCAPTCHA library on the checkout page.
*
* 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/
*/
@kimwhite
kimwhite / my-pmpro-manager-admin-bar.php
Last active June 16, 2023 11:30
Allow Manager Role to see Admin Bar when using WooCommerce
<?php // do not copy this line.
/**
* When using WooCommerce and our Manager Role Add On, this will allow our Manager role to see the Admin Bar
*
* 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/
*/
<?php //do not copy
/**
* This recipe will add a 'Commission' column to the Affiliate, Report and CSV Export tables
*
* Note, change the value of $pmpro_affiliate_rate to your preferred commission rate.
*
* 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.
@kimwhite
kimwhite / my-pmpro-addon-package-access.php
Last active January 25, 2022 14:25
Give access to specific Addon Packages by Level
<?php // do not copy this line.
/**
* Give user's with a certain level ID 4 free access to all some Addon Packages content.
*
* 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/
*/