Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 11:03 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_buddypress_pmpromd_profiles_redirect.php
Created February 12, 2026 08:12
Redirect BuddyBoss/BuddyPress Profile pages to PMPro Member Directory Profile pages.
<?php // copy from below.
/**
* Redirect BuddyBoss/BuddyPress Profile pages to PMPro Member Directory Profile pages.
*
* 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_buddypress_pmpromd_profiles_redirect() {
@dwanjuki
dwanjuki / my_pmpro_maintain_initial_payment_amount_on_renewal.php
Created February 10, 2026 08:26
Maintain Initial Payment amount from original checkout when members renew Level 1.
<?php
/**
* Maintain Initial Payment amount from original checkout when members renew
* level 1. Keeps existing active members on old price after changing level cost.
*
* 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_directory_before_pagination.php
Created February 9, 2026 07:38
Add script to clone Member Directory pagination to top of directory.
<?php
/**
* Add script to clone Member Directory pagination to top of 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_pmpro_member_directory_before_pagination() {
@dwanjuki
dwanjuki / my_pmpro_membership_card_left_remove_qr.php
Created February 5, 2026 13:19
Move PMPro Membership Card QR COde to the bottom right of the card.
<?php
/**
* Move PMPro Membership Card QR COde to the bottom right of the card.
*
* 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_membership_card_left_remove_qr( $card_content_left, $pmpro_membership_card_user, $atts ) {
@dwanjuki
dwanjuki / my_pmprogroupacct_get_groups_data.php
Created February 4, 2026 15:14
Output Group Code, Group IDs, Group Parents and Parent Levels
<?php // copy from below.
/**
* Get Group Accounts data.
*
* To run this script, visit yoursite.com/wp-admin/?pmpro_get_groups=1
*
* 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/
<?php // copy from below
/**
* Remove BuddyBoss theme's PMPro stylesheet.
*
* 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_remove_buddyboss_pmpro_styles() {
@dwanjuki
dwanjuki / my_pmpro_stripe_checkout_session_parameters_locale.php
Created January 21, 2026 08:32
Set language / locale for Stripe Checkout
<?php // copy from below.
/**
* Set Stripe Checkout language/locale.
*
* Possible locale values: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-locale
*
* 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_pmpropbc_added_order_save_fields.php
Created January 19, 2026 12:42
Save User Fields from checkout when a Pay By Check pending order is created.
<?php // copy from below.
/**
* Save User Field values from checkout when a Pay By Check pending order is 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpropbc_added_order_save_fields( $morder ) {
@dwanjuki
dwanjuki / my_pmprovp_remove_fields_discount_code_applied.php
Last active January 15, 2026 10:56
Remove Variable Pricing fields if a discount code is used
<?php
/**
* Remove the Variable Pricing fields if a discount code is applied at checkout.
*
* 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_pmprovp_remove_fields_discount_code_applied( $discount_code, $discount_code_id, $level_id, $code_level ) {
@dwanjuki
dwanjuki / pmpro_hide_billing_address_fields.php
Last active January 15, 2026 08:10
Hide PMPro Billing Address fields
<?php // copy from below.
/**
* Hide PMPro Billing Address 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/
*/
add_filter( 'pmpro_hide_billing_address_fields', '__return_true' );