Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 06:29 (UTC +03:00)
View GitHub Profile
@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/
*/
@dwanjuki
dwanjuki / my-pmpromd-display-element-html.php
Last active June 9, 2025 11:27 — forked from ipokkel/my-pmpromd-display-element-html.php
Allow some HTML tags when displaying textarea fields on the member directory
<?php
/**
* Allow some HTML tags when displaying textarea fields on the member directory.
*
* 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_pmpromd_display_element_html( $value, $element, $pu, $displayed_levels ) {
<?php // copy from below
/**
* Disable the PMPro default expiration warning email
*
* 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 / default-checkout-level.php
Last active June 3, 2025 15:47 — forked from andrewlimaza/default-checkout-level.php
Default checkout level if no level parameter
<?php
/**
* Set default checkout level if none is specified.
*
* 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/
*/