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
@dwanjuki
dwanjuki / my_pmpro_pbc_order_added_admin_email.php
Created June 21, 2024 09:27
Send admin an email notification on Pay By Check pending order creation
<?php
/**
* Send admin an email notification on Pay By Check pending order creation
*
* 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
function mypmpro_redirect_away_from_wc_endpoint(){
$current_endpoint = WC()->query->get_current_endpoint();
if($current_endpoint == "downloads" ) {
$user = wp_get_current_user();
<?php
/**
* Verify that the user is at least 18 years old before registering.
*
* 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 my_pmpro_min_required_age( $okay ) {
@ipokkel
ipokkel / pmpro-required-age-range.php
Created June 5, 2024 11:27
Check that a user has filled in a valid birthday date and that the date of birth falls inside a required set date range for the level they are checking out.
<?php
/**
* Require a specific age range for some 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_required_age_range( $okay ) {
@ipokkel
ipokkel / pmpro-change-recipient-for-billing-emails.php
Created April 25, 2024 07:05
Change the email recipient for a specified set of email templates if the intended recipient has an alternative recipient email address set as user meta.
<?php
/**
* Change the recipient for billing emails to an additional email address.
*
* 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 my_pmpro_change_recipient_for_billing_emails( $user_email, $email ) {
@kimwhite
kimwhite / sell-courses-addon-packages.php
Last active January 24, 2025 10:27 — forked from andrewlimaza/sell-series-addon-packages.php
Sell PMPro Course as AddOn Packages
<?php
/**
* Adds the AddOn Package post meta to 'Courses' post type.
* Give access if they purchased "Courses" parent container.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function add_pmpro_courses_to_AP( $types ) {
$types[] = 'courses';
@dparker1005
dparker1005 / memberslist_billing_address.php
Created February 28, 2024 16:12
Add the "billing address" column back to the members list and CSV export.
<?php
/**
* Add the "billing address" column back to the members list and CSV export.
*
* Note: This will add the most recent billing address for the user and level
* by looking at the user's order history, not user meta.
*
* 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.
<?php
/**
* Example usage of the pmpro_email_filter hook to customize the checkout_free email per 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/
*/
function my_pmpro_email_filter_checkout_free_per_level( $email ) {
@kimwhite
kimwhite / my-pmpro-change-seat-text.php
Last active April 24, 2024 17:46
Group Add On Change seat or seats to something else
<?php // do not copy this line.
/**
* This recipe will change the working Seat to what ever you choose
*
* use with Group Account Add On. https://www.paidmembershipspro.com/add-ons/group-accounts/
*
* 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 sends a different 'Application Approved' email when approving a member
* in the Approvals Add On based on their level.
*
* Does not support email templates at this point in time. Subject & Body should be updated in the code below.
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.