Skip to content

Instantly share code, notes, and snippets.

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

Mary Mojisola Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@andrewlimaza
andrewlimaza / change-set-expiration-date-programmatically.php
Created January 2, 2025 12:35
Programmatically change the Set Expiration Date from Y1 to Y2 when checkout is in October, November or December.
/**
* Adjust the Set Expiration Date Add On programmatically.
* Automatically adjust Y1-12-31 to be Y2-12-31 if the current month is October or later.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_programmatically_change_set_expiration_date( $raw_date ) {
// No Set Expiration Date, just bail.
if ( empty( $raw_date ) ) {
return $raw_date;
@ipokkel
ipokkel / my-pmpro-show-renew-link-when-level-expires-in-x-days.php
Created December 19, 2024 10:01
Show renewal link X days before expiration by hooking into pmpro_member_action_links. This is an alternative method to the one used in this guide: https://www.paidmembershipspro.com/schedule-renew-link-display/
@dwanjuki
dwanjuki / my_pmpro_group_account_removal_notification.php
Created December 18, 2024 13:23
Send email to user when removed from a group account via the Manage Group page
<?php
/**
* Send email to user when removed from a group account via the Manage Group 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/
*/
<?php
/**
* Add a "Total Memberships" column to the Members List and Users List.
*
* 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/
*/
// Add 'Total Memberships' Column to Members columns.
<?php
/**
* Add donation email vairable and reset membership cost value to exclude donation.
*
* 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_data_membership_cost_donation( $data, $email ) {
@dwanjuki
dwanjuki / my_get_avatar_url.php
Created November 28, 2024 08:50
Filter the output of the the get_avatar_url function to use our local avatar
<?php
/**
* Filter the output of the the get_avatar_url function to use our local avatar
*
* Guide: https://www.paidmembershipspro.com/custom-user-avatars-member-profile-edit-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 / pmpro-group-accounts-wp-menu-dynamic-link.php
Last active February 20, 2025 11:12 — forked from andrewlimaza/pmpro-group-accounts-wp-menu-dynamic-link.php
Create dynamic "Manage Account" link to be used in WordPress Menus for Paid Memberships Pro Group Accounts
@kimwhite
kimwhite / pmpro-approvals-denied-gets-set-level.php
Last active October 29, 2024 11:58 — forked from andrewlimaza/pmpro-approvals-delete-deny.php
Delete User on PMPro Approvals Deny. Delete denied user.
<?php // do not copy this line.
/**
* Automatically give user a set level when their approval is denied.
*
* 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-group-accounts-wp-menu-dynamic-link.php
Last active January 27, 2025 09:57
Create dynamic "Manage Account" link to be used in WordPress Menus for Paid Memberships Pro Group Accounts
@kimcoleman
kimcoleman / my_pmpro_template_url_parameter_at_checkout.php
Created October 8, 2024 13:19
Redirect away from checkout if the secret URL parameter is missing.
<?php
/**
* Redirect away from checkout if the secret URL parameter is missing.
*/
function my_pmpro_template_url_parameter_at_checkout() {
global $pmpro_pages;
// Return early if we are not on a PMPro page.
if ( empty( $pmpro_pages ) ) {
return;