Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 06:45 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_disable_bp_activity_page.php
Last active March 9, 2026 15:34
Hide BuddyPress activity from members pending approval.
<?php
/**
* Hide BuddyPress activity from members pending approval.
*
* 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_sql_search_where.php
Created March 9, 2026 10:08
Update the member directory search sql query to check a single custom field, return exact matches
<?php
/*
* Update the member directory search sql query to check a single custom field.
* Return results only if the custom field value exactly matches the search term.
*
* Replace custom_field_name with your custom field name (meta key).
*
* 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 / my_buddypress_pmpromd_profiles_redirect.php
Last active February 20, 2026 08:13
Redirect BuddyBoss/BuddyPress Profile pages to PMPro Member Directory Profile pages.
<?php // copy from below.
/**
* Redirect BuddyBoss/BuddyPress Member Directory 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 ) {