Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 20:26 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_pmpropp_custom_plan_cost_text.php
Created August 21, 2025 09:40
Customize the payment plan cost text on the level 2 checkout page
<?php
/**
* Customize the payment plan cost text on the level 2 checkout 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/
*/
function my_pmpropp_custom_plan_cost_text( $plan_name_raw, $plan ) {
@dwanjuki
dwanjuki / my_pmpromd_profile_user_field_value_shortcode.php
Last active August 13, 2025 08:45
Add a [pmpromd_user_field] shortcode that displays User Field values on the Member Directory "Profile" pages.
<?php
/**
* Add a [pmpromd_user_field] shortcode to display User Field values on the
* Member Directory Profile pages.
*
* Usage: [pmpromd_user_field field_name="your_field_name"]
*
* This is an advanced customization recipe that may require further development
* to suit specific needs and/or setups. For more details, please see:
* https://www.paidmembershipspro.com/developers/
@dwanjuki
dwanjuki / pmpro_advanced_levels-compare_table.css
Last active August 12, 2025 08:30
PMPro Advanced Levels compare table highlight example CSS
#pmpro_levels.pmpro_advanced_levels-compare_table thead tr:first-child th.pmpro_level-highlight::before {
content: "★ RECOMMENDED ★";
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
background: #007cba;
color: white;
padding: 8px 15px;
border-radius: 20px;
@dwanjuki
dwanjuki / my_pmpro_user_fields_add_html_attributes.php
Created August 11, 2025 10:40
Add placeholder HTML attribute to PMPro user fields
<?php
/**
* Add placeholder HTML attribute to PMPro user fields.
*
* 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_user_fields_add_placeholder( $field, $where ) {
@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 / 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/
*/