Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 14:28 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_pmpro_buddypress_profile_template_redirect.php
Last active July 4, 2024 08:19 — forked from kimwhite/my_pmpro_buddypress_profile_template_redirect.php
Redirect the PMPro Profile Edit and Password Reset pages to the user's BuddyPress Profile and Settings pages respectively
<?php
/**
* Redirect the PMPro Profile Edit and Password Reset pages
* to the user's BuddyPress Profile and Settings 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/
*/
@dwanjuki
dwanjuki / my_pmpro_group_accounts_gettext_seat.php
Last active July 29, 2024 09:30 — forked from andrewlimaza/my-pmpro-change-seat-to-member.php
Change the word "Seat(s)" to "Membership(s)" for the Group Accounts Add On
<?php
/**
* This will change all instances of seat(s) to membership(s) for the Group Accounts Add On
*
* 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-required-attribute-to-input.php
Last active August 21, 2024 15:03 — forked from ipokkel/my-pmpro-add-required-attribute-to-input.php
Add the HTML5 required attribute to all checkout fields that has the pmpro_required class for front-end validation that checks that a required field is not empty before processing the form submit.
<?php
/**
* This recipe adds the HTML5 attribute "required" to all required
* fields on the checkout page that has the class "pmpro_form_input-required"
* to check that a required field is not empty before submitting.
*
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required
*
* 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.
@dwanjuki
dwanjuki / pmpro-prevent-checkout-for-current-levels.php
Last active October 1, 2024 07:41 — forked from ipokkel/pmpro-prevent-checkout-for-current-levels.php
Prevent users from checking out for a level they already have, unless the level is expiring soon and the user can renew.
<?php
/**
* Prevent users from checking out for a level they already have,
* unless the level is expiring soon and the user can renew.
*
* 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-open-comments-non-members.php
Last active October 15, 2024 07:37 — forked from andrewlimaza/pmpro-open-comments-non-members.php
Allows non-members to view comments and comment on restricted posts
<?php
/**
* Allows non-members to view comments and comment on restricted posts
*
* 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 make_pmpro_comments_open(){
@dwanjuki
dwanjuki / conpd-immediately-if-trial.php
Last active November 7, 2024 12:54 — forked from andrewlimaza/conpd-immediately-if-trial.php
Cancel Members Immediately if they cancel during the trial period (Subscription Delays)
<?php
/**
* Cancel members immediately if they are cancelling within the Subscription Delay Limit of their level
*
* Works on PMPro v3.0+
*
* 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_hide_arc_if_pbc_selected_script.php
Last active January 9, 2025 08:17 — forked from andrewlimaza/remove-auto-renewal-checkbox.php
Remove Auto Renewal Checkbox if Pay by Check is selected
<?php
/**
* Remove Auto Renewal Checkbox if Pay by Check is selected
*
* 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_confirmation_url.php
Last active January 15, 2025 13:22 — forked from strangerstudios/my_pmpro_confirmation_url.php
Example of using the pmpro_confirmation_url filter to change the PMPro confirmation page for new users.
<?php
/**
* Change the membership confirmation page for new members only
*
* 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_confirmation_url($url, $user_id, $level) {
@dwanjuki
dwanjuki / add_excerpt_to_wordpress_page.php
Last active July 2, 2025 12:45 — forked from andrewlimaza/add_excerpt_to_wordpress_page.php
Add Excerpt Functionality To WordPress Pages
<?php
/**
* Add Excerpt Functionality To WordPress 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/
*/
@dwanjuki
dwanjuki / my_pmpro_show_hide_discount_code.php
Last active February 28, 2025 09:05 — forked from JarrydLong/mypmpro-hide-discount-field-specific-level.php
Show the discount code field on checkout for specified levels, hide on others
<?php
/**
* Show the discount code field on checkout for specific levels only
*
* 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/
*
*/