Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 01:00 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_first_last_display_name.php
Last active June 25, 2025 09:32 — forked from kimcoleman/my_first_last_display_name.php
Set Display Name on Membership Checkout and for BuddyPress Nickname field.
<?php
/**
* Set Display Name on Membership Checkout and for BuddyPress Nickname field.
*
* 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_first_last_display_name( $user_id ) {
@dwanjuki
dwanjuki / my_pmpro_email_expiration.php
Last active June 6, 2025 13:12 — forked from andrewlimaza/my_pmpro_email_expiration.php
Change when the expiration email is sent out for PMPro
<?php
/**
* Change when the expiration email get's sent out to users.
*
* 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-element-html.php
Last active June 9, 2025 11:27 — forked from ipokkel/my-pmpromd-display-element-html.php
Allow some HTML tags when displaying textarea fields on the member directory
<?php
/**
* Allow some HTML tags when displaying textarea fields on the member 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_pmpromd_display_element_html( $value, $element, $pu, $displayed_levels ) {
<?php // copy from below
/**
* Disable the PMPro default expiration warning 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/
*/
@dwanjuki
dwanjuki / default-checkout-level.php
Last active June 3, 2025 15:47 — forked from andrewlimaza/default-checkout-level.php
Default checkout level if no level parameter
<?php
/**
* Set default checkout level if none is specified.
*
* 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_wp_change_password_hint.php
Last active June 3, 2025 15:11 — forked from andrewlimaza/change-wp-password-hint.php
Change WordPress Password Hint Text
<?php
/**
* Change the WordPress password hint text.
*
* 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 / disable_gravity_forms_recaptcha_on_pmpro_checkout.php
Last active May 14, 2025 10:20 — forked from ipokkel/disable-cf7-recaptcha.php
Disable Gravity Form's reCAPTCHA on the checkout page for PMPro
<?php
/**
* This recipe stops Gravity Form's recaptcha javascript from loading
* on the PMPro checkout page. This helps prevent conflicts from recaptcha
* being loaded twice.
*
* 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_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 / 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/