Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 21:55 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_pmpropp_show_plans_after_pricing_fields.php
Created November 26, 2025 09:40
Show Payment Plans after Membership Information on checkout page.
<?php // copy form below.
/**
* Show Payment Plans after Membership Information on 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_show_plans_after_pricing_fields() {
<?php // copy form below.
/**
* Change the "Select a Payment Plan" heading for a specific level
*
* 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_level_checkout_gettext( $pmpro_level ) {
@dwanjuki
dwanjuki / my_pmpropp_exclude_default_level_price.php
Created November 26, 2025 09:00
Exclude the default level billing price from payment plan radio options at checkout
<?php // copy from below.
/**
* Exclude the default level billing price from payment plans 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_pmpropp_exclude_default_level_price( $include_level_price, $level_id ) {
@dwanjuki
dwanjuki / my_pmpro_vat.php
Created November 19, 2025 12:10
Add 20% tax to all membership checkouts
<?php
/**
* Add 20% VAT tax to all membership checkouts.
*
* 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_pressidium_analytics_cookie_consent_granted.php
Last active November 17, 2025 14:54 — forked from JarrydLong/mypmpro-cookies-cookiebot-compat.php
Disable pmpro_visit cookie if the user has not consented to Analytics cookies via the Pressidium Cookie Consent plugin.
@dwanjuki
dwanjuki / my_pmpro_lifterlms_single_course_redirect_non_members.php
Created November 7, 2025 09:50
Redirect users without membership access from LifterLMS single course pages to membership checkout.
<?php
/**
* Redirect users without membership access from LifterLMS single course pages to membership 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_pmpro_lifterlms_single_course_redirect_non_members() {
@dwanjuki
dwanjuki / my_pmpro_check_pending_admin_email_data_custom.php
Created November 4, 2025 09:34
Include User Fields in Check Pending Admin email
<?php
/**
* Include checkout data from pending order as email variables in the Check Pending Admin 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/
*/
function my_pmpro_check_pending_admin_email_data_custom( $data, $email ) {
@dwanjuki
dwanjuki / pmpro-tag-delete-inactive-users.php
Last active October 27, 2025 09:11 — forked from kimcoleman/pmpro-tag-delete-inactive-users.php
Script to tag and delete inactive PMPro Members and users from WordPress.
<?php
/**
* Script to locate, tag, export, then delete inactive users in your Paid Memberships Pro / WordPress website.
*
* Once this snippet is in the site, admins can run the process by visiting /?delete_inactive_users=1 in the WordPress admin.
* Always back up user data before running any bulk delete script and remove this code after the process is done.
*/
function my_register_user_activity_taxonomy() {
register_taxonomy(
'my_user_activity',
@dwanjuki
dwanjuki / pmpro_membership_card-print-lg-background.css
Created October 8, 2025 08:32
Add a background image to the Membership Card large print
.pmpro_membership_card-print-lg {
background: url(https://example.com/path-to-your-image.jpg) !important;
background-size: cover !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
@dwanjuki
dwanjuki / my_pmproiucsv_adjust_ajax_import_batch_size.php
Last active October 21, 2025 08:54
Change batch size when importing members from CSV via AJAX
<?php
/**
* Change batch size when importing members from CSV via AJAX. Default: 50
*
* 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_pmproiucsv_adjust_ajax_import_batch_size( $number ) {