Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 19:01 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_send_email_after_validation.php
Last active February 2, 2023 13:13 — forked from andrewlimaza/send_custom_email.php
Send a custom email to user after the user's email is validated
<?php
/**
* Add this code to your PMPro Customizations Plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* This function below sends a custom HTML email to the user that checks out for a pmpro membership level, easily extendible to send to admins, or specific users and so on.
* Website: https://paidmembershipspro.com
*/
function my_send_email_after_validation( $user_id ){
@dwanjuki
dwanjuki / my-pmpro-email-data.php
Last active February 9, 2023 07:32 — forked from ipokkel/my-pmpro-email-data.php
This recipe adds user fields as email variables that may be used in PMPro Email Templates.
<?php
/**
* This recipe adds a user field as an email variable !!your_field_name!! that may be used in PMPro Email Templates.
*
* 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/
*/
<?php
/**
* This recipe adds user fields to the invoice 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_email_data_membership_level_name.php
Created February 20, 2023 09:47 — forked from ipokkel/my_pmpro_email_data_membership_level_name.php
Add !!membership_level_name!! for PMPro expired email template.
<?php
/**
* Add !!membership_level_name!! to Paid Memberships Pro expired email template.
*
* 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_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 / pmpro-give-expired-members-a-level.php
Last active April 27, 2023 15:11 — forked from greathmaster/pmpro-give-expired-members-a-level.php
When members expire we give them another "expired" level. If they cancel, then let them cancel.
<?php
/**
* When users expire we give them an "expired" level.
* Set your "expired" level ID on line 26
*
* 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_restricted_posts_require_membership_level.php
Last active August 15, 2024 14:03 — forked from kimcoleman/my_restricted_pages_require_user_login.php
Restrict specific posts/pages in your WordPress site for members of a level, redirect other visitors away
<?php // copy from below
/**
* Restrict specific posts/pages in your WordPress site for members of 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_members_only_woocommerce_add_to_cart.php
Last active May 29, 2023 09:37 — forked from andrewlimaza/hide_prices_woo_pmpro.php
Hide WooCommerce Add to Cart buttons from users without the required membership level
<?php
/*
* Hide WooCommerce Add to Cart buttons from users without the required membership levels
*
* Specify Level IDs that are allowed to make purchases on line 16
*
* 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/