Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David dwanjuki

  • Nairobi, Kenya
  • 19:45 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_pmpro_bulk_generate_membership_numbers.php
Created February 23, 2023 11:23
Bulk generate membership numbers for members without one.
<?php
/**
* Bulk generate membership numbers for members without one.
* Requires generate_member_number snippet from https://www.paidmembershipspro.com/generate-a-unique-member-number/
*
* 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_donations.php
Last active February 23, 2023 14:59 — forked from greathmaster/pmpro-custom-donation-categories.php
Donate to specific categories or causes using PMPro User Fields
<?php
/**
* Donate to specific categories or causes using PMPro User Fields. This is different and independent from the PMPro Donations 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 / trigger_popup_maker_with_limit_post_views.php
Created March 9, 2023 07:08 — forked from kimcoleman/trigger_popup_maker_with_limit_post_views.php
Trigger a Popup Maker to display on the redirected page once the post views limit is reached.
<?php
/**
* Trigger a Popup Maker to display on the redirected page once the post views limit is reached.
* Requires: https://www.paidmembershipspro.com/add-ons/pmpro-limit-post-views/ and https://wordpress.org/plugins/popup-maker/
*/
function trigger_popup_maker_with_limit_post_views() {
// Check cookie for views value and compare to limit based on visitor/user.
if ( ! empty( $_COOKIE['pmpro_lpv_count'] ) ) {
global $current_user;
@dwanjuki
dwanjuki / my_pmpromd_append_profile_taxonomy_term_links.php
Created March 10, 2023 12:21
This recipe adds a list of linked taxonomy terms to the bottom of the member profile
@dwanjuki
dwanjuki / my_pmpro_zapier_send_discount_code.php
Created March 17, 2023 06:49
Send Discount Code to Zapier using the "After Checkout" Trigger
<?php
/**
* Send Discount Code to Zapier using the "After Checkout Trigger".
*
* 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_zapier_send_discount_code( $data, $user_id, $level, $order ) {
@dwanjuki
dwanjuki / my_pmproio_display_invite_codes.php
Created March 20, 2023 09:31
Add a shortcode to display the current user's invite code(s)
<?php
/*
* Adds a [display_invite_codes] shortcode that outputs the current user's invite code(s)
*
* 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_lostpassword_redirect.php
Created March 27, 2023 14:28
Redirect to URL after password reset
<?php
/*
* Redirect to url after password reset
*
* 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_canadian_tax.php
Created March 28, 2023 09:57 — forked from dparker1005/my_pmpro_canadian_tax.php
Apply Canadian taxes to Checkouts with PMPro
<?php
/*
* Plugin Name: Paid Memberships Pro - Canadian Tax
* Description: Apply Canadian taxes to Checkouts with PMPro
* Version: .1
* Author: Stranger Studios
* Author URI: http://www.strangerstudios.com
*/
/*
@dwanjuki
dwanjuki / my_pmpro_login_forms_handler_nav_links.php
Last active March 29, 2023 12:05
Change password reset URL that appears on PMPro login forms
@dwanjuki
dwanjuki / my_pmpro_return_old_members.php
Created April 5, 2023 07:13
Return an array of old members
<?php
/**
* Return an array of expired and cancelled members (old members)
*
* 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/
*
*/