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 / 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/
*/
@kimwhite
kimwhite / generate_member_number.php
Last active December 5, 2022 19:22 — forked from strangerstudios/generate_member_number.php
Code to generate incremental Member Number values for PMPro users/members.
<?php // do not copy this line.
/**
* This recipe creates Member Numbers
* Change the generate_member_number function if your member number needs to be in a certain format.
* Member numbers are generated when users are registered or when the membership account page is accessed for the first time.
*
* 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.
@ipokkel
ipokkel / block-restricted-email-addresses-pmpro-registration-checks.php
Created January 12, 2022 06:24
Block restricted specific email addresses from checking out for a membership.
<?php
/**
* Exclude specific email domains from membership signup.
* Make sure to edit the $invalid_domains array defined further below
* to include only the domains you'd like to block.
*
*/
function block_restricted_email_addresses_pmpro_registration_checks( $value ) {
// set array of restricted email addresses.
@ipokkel
ipokkel / my-pmprorh-extra-fields-admin-email.php
Last active June 27, 2023 12:39
Add Register Helper fields to the admin checkout notification email.
<?php
/**
* Add Custom Registration Fields and their values to the Admin Checkout Notification Email.
*
* 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/
*/