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 / pmpromd-disable-oembed.php
Last active September 18, 2024 16:32
Remove embeds on the PMPro Member Directory pages. #oembed
<?php
/**
* Remove embeds on the PMPro Member Directory pages.
*
* 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 / send-admin-email-update-user.php
Last active November 5, 2024 15:32
Send admin an email when a user updates their email address in their WordPress profile.
<?php
/**
* Send admin an email when a user's email is updated via their Edit Profile page.
* Full Guide - https://yoohooplugins.com/send-email-to-admins-on-wordpress-profile-update/
* Add this code to your site by following - https://yoohooplugins.com/customize-wordpress/
*/
function yh_send_admin_email_user_updated( $user_id, $old_data, $new_data ) {
// Send an email to an admin when the user's email changes.
if ( $old_data->data->user_email !== $new_data['user_email'] ) {
@ipokkel
ipokkel / email-custom-membership-expiring-template-per-level.php
Last active July 21, 2023 13:42
Custom membership expiring email subject and template per membership level.
<?php
/**
* This recipe sets a custom membership expiring 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.
@dparker1005
dparker1005 / next_last_payment_dates_members_list.php
Last active August 10, 2023 15:38 — forked from kimcoleman/next_last_payment_dates_members_list.php
Adds last payment date and next payment date to the members list and export CSV in Paid Memberships Pro (PMPro).
<?php
/**
* Adds last payment date and next payment date to the members list and export CSV.
* Note that "last payment" value will get the last order in "success", "cancelled", or "" status. (Oddly enough, cancelled here means that the membership was cancelled, not the order.)
*
* The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date. It may be off from the actual recurring date set at the gateway, especially if the subscription was updated at the gateway.
*
* 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 / remove-payment-plans-if-discount-code-applied.php
Created June 20, 2022 09:30
Removes payment plans from a membership level checkout if a discount code is applied.
<?php
/**
* This recipe removes payment plans from the PMPro checkout page if a
* discount code is applied.
*
* 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/
*/
@dparker1005
dparker1005 / my_pmprosm_create_sponsor_code_if_needed.php
Last active May 18, 2023 13:00
When a user logs in, check if they have a sponoring level but don't have a sponsor code. If this is the case, create one.
<?php
// Copy from below here...
/**
* When a user logs in, check if they have a sponoring level but don't have
* a sponsor code. If this is the case, create one.
*
* IMPORTANT: If your sponsored members code is set up setting `seats` instead of
* `max_seats`, this code will need to be udpated accordingly.
<?php // do not copy this line.
/**
* Sponsored Members setup with child seat costs at checkout.
* SPONSOR SEAT + 4 seats 19.95 each
* + 5 to 19 @ 17.95
* + 20 to 39 @ $15.95
* + 40 to 79 @ 14.95
*
* 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.
@ipokkel
ipokkel / restrict-buddypress-activity-page.php
Created May 18, 2022 10:14
Restrict and redirect non-members away from the BuddyPress activity or BuddyBoss news feed page.
<?php
/**
* Restrict and redirect non-members away from the BuddyPress activity page (news-feed).
*
* 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 display the earnings value of an affiliate via shortcode.
* Add [affiliate_earnings] to a page to display the current users earnings.
*
* The default roles that we're looking for are subscribers. You can change this on line 18
* The number of days a cookie will remain active before expiring is 30 days (Line 49)
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/