Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 11:58 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / open_category_posts_to_all_visitors.php
Created January 17, 2025 08:58
Make posts in specified categories accessible to everyone
<?php
/**
* Posts in specified categories will not require membership to view
*
* 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 / my_custom_no_access_message_html_icon.php
Created January 9, 2025 10:49
Replace the Protected Content Message icon HTML
<?php
/**
* Replace the Protected Content Message icon HTML
*
* 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_group_account_removal_notification.php
Created December 18, 2024 13:23
Send email to user when removed from a group account via the Manage Group page
<?php
/**
* Send email to user when removed from a group account via the Manage Group 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_pmpro_member_links_top_parent_user_page.php
Last active December 18, 2024 11:32
Add parent User Page link to top of Member Links list
@dwanjuki
dwanjuki / my_custom_membership_expiration_text.php
Created December 2, 2024 11:14
Change account page membership expiration text
<?php
/**
* Modify account page membership expiration 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 / my_pmpro_checkout_checks_require_code_to_register.php
Created November 29, 2024 15:00
Require a discount code to register for a level
<?php
/**
* Require a discount code to register for a 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/
*/
@dwanjuki
dwanjuki / my_pmpro_date_user_field_save_function.php
Last active February 19, 2025 14:32
Sync a date from a BuddyPress xprofile field to a PMPro usermeta field and vice versa
<?php
/**
* Sync a date from a BuddyPress xprofile field to a PMPro usermeta field and vice versa
*
* 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_get_avatar_url.php
Created November 28, 2024 08:50
Filter the output of the the get_avatar_url function to use our local avatar
<?php
/**
* Filter the output of the the get_avatar_url function to use our local avatar
*
* Guide: https://www.paidmembershipspro.com/custom-user-avatars-member-profile-edit-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/