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
<?php
/**
* Hides empty elements on the directory and profile pages.
*
* Can be useful if you have a select type user field
* and you don't want to display them if they are empty.
* This requires the first select field option to be configured
* with no value set, a colon, and a label set. e.g. ":label".
*
* For example:
<?php //do not copy
/**
* This recipe gets a customer's Tax ID and country from the webhook
*
* Create two User fields with the names pmpro_stripe_tax_type and pmpro_stripe_tax_id to view
* the tax type and tax ID in the member's profile.
*
* 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.
@dwanjuki
dwanjuki / my_pmpro_add_order_details_to_email.php
Last active May 2, 2025 16:38 — forked from andrewlimaza/add-invoice-details-to-email-pmpro.php
Add subtotal (!!invoice_subtotal!!) and tax (!!invoice_tax!!) variables to email templates
<?php // copy from below
/**
* Add !!invoice_subtotal!! and !!invoice_tax!! variables to email templates where an Order ID is available.
*
* 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_add_order_details_to_email( $data, $email ) {
@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