Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 05:30 (UTC +03:00)
View GitHub Profile
@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 / my_pmprosd_default_state.php
Last active August 4, 2025 07:57
Set a default state for the State Dropdowns Add On.
<?php
/**
* Set a default Mailing Address state (State Dropdowns Add On)
*
* Setting a default country:
* https://github.com/strangerstudios/pmpro-snippets-library/blob/dev/checkout/set-pmpro-default-country.php
*
* 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.
@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 / my_pmpro_levels_page_cost_text_add_plans.php
Created July 30, 2025 08:49
Include Payment Plans in the level cost text on the frontend Levels page.
<?php
/*
* Include Payment Plans in the level cost text on the frontend 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_pmpromd_display_search_results_only.php
Created July 28, 2025 15:09
Show profiles in the Member Directory only if a search is performed.
<?php
/*
* Show profiles in the Member Directory only if a search is performed.
*
* 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_zapier_admin_change_email_after_add_member.php
Last active September 4, 2025 10:50
Send PMPro admin change email after registering a member through a PMPro Zapier zap.
<?php
/**
* Send PMPro admin change email after registering a member through a PMPro Zapier zap.
*
* Requires Paid Memberships Pro and PMPro Zapier Add On to be installed and activated.
* https://www.paidmembershipspro.com/add-ons/pmpro-zapier/
*
* 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.
@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_pmpro_member_sql_search_where.php
Created July 7, 2025 07:53
Filter directory search conditions to exclude fields from usermeta search
<?php
/**
* Filter directory search conditions to exclude fields from usermeta search
*
* 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 / remove_pmpro_membership_levels_table_on_profile.php
Created June 24, 2025 13:48
Remove the Membership Levels section from the WordPress Edit User admin page
<?php
/**
* Remove the Membership Levels section from the Edit User 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/
*/