Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 17:39 (UTC +03:00)
View GitHub Profile
<?php
/**
* This recipe will check if a member has an active level associated with
* their account. It will add either 'active' or 'inactive' to QR code's data.
*
* Set your shortcode to [pmpro_membership_card qr_code='true' qr_data='other']
* for this filter to take effect.
*
* 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 / pmpro-invoice-bullets-example.php
Last active September 29, 2025 10:46 — forked from ipokkel/pmpro-invoice-bullets-example.php
Display Company Name as a bullet on the PMPro Invoice
<?php
/**
* Display Company Name as a bullet on the PMPro Invoice.
*
* 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 / pmpro-approvals-bcc-admin-emails-to-users-with-pmpro-approvals-capability.php Send a copy of PMPro Approval admin notification emails to users that have the pmpro_approvals capability. This should include users that has the pmpro_approver role or the pmpro_membership_manager role role.
<?php
/**
* Bcc admin approval emails to users with pmpro_approvals capability.
*
* 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 pmpro_approvals_bcc_admin_notification_emails( $headers, $email ) {
@dwanjuki
dwanjuki / my-pmpro-valid-shipping-zip-codes.php
Last active September 2, 2025 15:45 — forked from travislima/my-pmpro-valid-shipping-zip-codes.php
Only allow mailing to specific Zip Codes.
<?php
/**
* This will only allow users to checkout with specific zip codes for the Mailing Add On.
*
* 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_valid_mailing_zip_codes( $pmpro_continue_registration ) {
@dwanjuki
dwanjuki / pmpro-limited-time-registration.php
Last active August 27, 2025 10:59 — forked from LMNTL/pmpro-limited-time-registration.php
Restrict a membership level to no longer allow sign ups after a given date (limited time offer) using Paid Memberships pro
<?php
/**
* Checks to see if a registration is happening after a given date.
* If so, prevents registration and stop new signups for the level.
* And remove the level from the levels 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/
@dwanjuki
dwanjuki / my_pmpro_is_level_expiring_soon.php
Last active August 4, 2025 11:14 — forked from andrewlimaza/disable_double_checkout.php
Do not allow membership renewal unless the level is expiring in the next 45 days.
<?php
/**
* Do not allow membership renewal unless the level is expiring in the next 45 days.
*
* 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 / move-pmpro-content-higher.php
Last active July 31, 2025 09:59 — forked from andrewlimaza/move-pmpro-content-higher.php
Move the content restricted message higher up the course content for LifterLMS
<?php
/**
* Move the Paid Memberships Pro content restricted message higher up in LifterLMS course content.
* This requires "Course Information" block to be on the page and shown before this using jQuery.
* Tweak this jQuery code to fit your needs and move the content higher up.
*
* To add the code to your site you may follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_move_pmpro_div_with_jquery_llms() {
@dwanjuki
dwanjuki / last_payment_date_members_list.php
Last active July 14, 2025 08:25 — forked from dparker1005/next_last_payment_dates_members_list.php
Adds last payment date to the members list and export CSV in Paid Memberships Pro (PMPro).
<?php
/**
* Adds last payment date to the members list and export CSV.
*
* 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_first_last_display_name.php
Last active June 25, 2025 09:32 — forked from kimcoleman/my_first_last_display_name.php
Set Display Name on Membership Checkout and for BuddyPress Nickname field.
<?php
/**
* Set Display Name on Membership Checkout and for BuddyPress Nickname field.
*
* 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_first_last_display_name( $user_id ) {
@dwanjuki
dwanjuki / my_pmpro_email_expiration.php
Last active June 6, 2025 13:12 — forked from andrewlimaza/my_pmpro_email_expiration.php
Change when the expiration email is sent out for PMPro
<?php
/**
* Change when the expiration email get's sent out to users.
*
* 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/
*/