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
@dparker1005
dparker1005 / my_pmpro_prevent_name_save_at_checkout.php
Created March 8, 2023 15:14
Do not update user's first and last name while on the PMPro Checkout page. Useful if you do not want the user's billing name to be the name on the account.
<?php
// Copy from below here.
/**
* Do not update user's first and last name while on the PMPro Checkout page.
* Useful if you do not want the user's billing name to be the name on the account.
*/
function my_pmpro_prevent_name_save_at_checkout( $check, $object_id, $meta_key ) {
if ( $meta_key === 'first_name' || $meta_key === 'last_name' ) {
<?php //do not copy
/**
* This recipe adds the pmpro_pending_approval class to the pmpro_content_message
* element if the current user is pending approval.
*
* 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/
@ipokkel
ipokkel / remove-gift-aid-text-from-checkout-page.php
Created February 8, 2023 12:55
Remove PMPro Gift Aid text from checkout page for specified levels in the $no_gift_aid_level_ids variable.
<?php
/**
* Remove the gift aid text from the checkout page for specified 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/
*/
@dwanjuki
dwanjuki / my_pmpro_email_renewaldate_data.php
Created February 1, 2023 15:44
This recipe makes the !!renewaldate!! variable available for use in all Paid Memberships Pro emails.
<?php
/**
* This recipe makes the !!renewaldate!! variable available for use in all Paid Memberships Pro emails.
* When the variable is empty it will display nothing instead of the !!renewaldate!! email variable
*
* Notice the array key does not include the !!s
*
* 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
/**
* Example of extending a user field to add a depends
*
* This recipe assumes a checkbox field with the name my_checkbox was created.
* This recipe assumes a textarea field with the name my_textarea was created.
*
* 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
/**
* This recipe creates Member Numbers with a prefix that may be customized per level ID.
*
* 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.
*
* Set your default member number prefix in the $member_number_prefix variable.
*
@ipokkel
ipokkel / pmpro-disable-invoice-email-per-level.php
Created November 18, 2022 14:46
Disable PMPro Invoice emails per level.
<?php
/**
* Disable the PMPro invoice email for specified 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/
*/
@ipokkel
ipokkel / pmpro-bcc-invoice-emails.php
Last active May 1, 2023 20:11
Send a copy of invoice email to an additional email address if the member has set an addtional email address.
<?php
/**
* Send a copy of an Invoice email i a member has specified and additional invoice email addresses.
*
* This recipe require an additional email address to be set in usermeta table.
*
* Collecting an additional invoice email address should be achievable with a custom User Field.
* @link https://www.paidmembershipspro.com/documentation/user-fields/
*
* You can add this recipe to your site by creating a custom plugin
@MaryOJob
MaryOJob / member_days_left_pmpro.php
Created November 15, 2022 20:04 — forked from andrewlimaza/member_days_left_pmpro.php
Show "Days Left" for Paid Memberships Pro
<?php
//Copy lines 5 onwards into your PMPro Customizations plugin -> https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
/**
* Add days left to members list
*/
function my_pmpro_days_left_members_list_col_header( $theusers )
{
?>
@MaryOJob
MaryOJob / pmpro-change-level-recurring.php
Created November 15, 2022 20:04 — forked from ronalfy/pmpro-change-level-recurring.php
PMPro - Change Never Label Message for Recurring Levels
<?php
/**
* Changes the output label to Recurring in member/order lists for recurring 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/
*/
/**