Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 11:59 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_pmpro_tax_agst.php
Created April 8, 2025 14:03
Apply 10% tax (GST) if Billing Address is in Australia
<?php
/**
* Apply 10% tax if Billing Address is in Australia
*
* Requires Billing Address fields 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/
@dwanjuki
dwanjuki / my_pmpromd_allowed_html.php
Last active April 7, 2025 11:04
Add source tag and its src and type attributes to Member Directory allowed HTML
<?php
/**
* Add source tag and its src and type attributes to Member Directory allowed HTML
*
* Resolves issue with audio and video not playing
*
* 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_hide_group_field_on_ap_checkout.php
Created April 7, 2025 08:37
Hide Group Accounts field on Addon Package Checkout pages
<?php
/**
* Hide Group Accounts field on Addon Package Checkout 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_pmpro_hide_group_field_on_ap_checkout() {
@dwanjuki
dwanjuki / my_pmpro_bcc_membership_expired_email.php
Last active April 4, 2025 15:14 — forked from kimwhite/my_pmpro_email_headers_admin_emails.php
This recipe will BCC additional email addresses when a member expired
<?php // do not copy this line.
/**
* This recipe will BCC additional email addresses when a member expired
*
* 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_tribe_events_archive_require_membership.php
Created April 4, 2025 11:55
Redirect visitors without membership access form the The Events Calendar archive page
<?php
/**
* Redirect visitors without membership access form the The Events Calendar archive 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 / change-text-for-addon-package-checkout.php
Created April 4, 2025 08:14 — forked from ipokkel/change-text-for-addon-package-checkout.php
Change the text for the addon package checkout page to only show the post title and exclude the level name.
<?php
/**
* Change the text for the addon package 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/
*/
// Swap the pmproap_pmpro_checkout_level filter with our custom one.
<?php
/**
* This recipe will hide the discount code field on the checkout page if no discount codes
* have been created for that specific level, or if the current date is not between the
* exisiting discount codes' Start and Expiration dates
*
* 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_tiered_levels_prevent_downgrade.php
Last active March 25, 2025 11:05
Create level hierarchy / tiers. Prevent downgrade to lower levels
<?php // copy from below
/**
* This recipe will prevent users from downgrading to a "lower" level
*
* Not compatible with multiple memberships per user
*
* 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 / pmpro_no_access_message_html.php
Created March 14, 2025 11:14
Remove PMPro Protected Content Messages sitewide
<?php
/**
* Remove PMPro Protected Content Messages sitewide
*
* 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_add_order_details_to_email.php
Last active March 12, 2025 10:40 — forked from andrewlimaza/add-invoice-details-to-email-pmpro.php
Add subtotal (!!invoice_subtotal!!) and tax (!!invoice_tax!!) variables to email templates
<?php // copy from below
/**
* Add !!invoice_subtotal!! and !!invoice_tax!! variables to email templates where an Order ID is available.
*
* 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_add_order_details_to_email( $data, $email ) {