Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 04:05 (UTC +03:00)
View GitHub Profile
@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/
@dwanjuki
dwanjuki / my_pmpro_add_order_details_to_email.php
Last active May 2, 2025 16:38 — forked from andrewlimaza/add-invoice-details-to-email-pmpro.php
Add subtotal (!!invoice_subtotal!!) and tax (!!invoice_tax!!) variables to email templates
<?php // copy from below
/**
* Add !!invoice_subtotal!! and !!invoice_tax!! variables to email templates where an Order ID is available.
*
* 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_add_order_details_to_email( $data, $email ) {
@dwanjuki
dwanjuki / my-pmpro-series-shortcode.php
Created March 7, 2025 14:54 — forked from ipokkel/my-pmpro-series-shortcode.php
Shortcode to display a series' list of articles with their available date. #pmpro_series #shortcode
<?php
/**
* This recipe creates a shortcode that shows the list of articles for a specific series.
* Use [pmpro_series id="n"] on any page/post to display a list of posts that belong to a series.
* The attribute "id" is the post ID of the series and is required, e.g [pmpro_series id="123"]
*
* This recipe assumes the site has the PMPro Series: Drip Feed Add On active.
* @link https://www.paidmembershipspro.com/add-ons/pmpro-series-for-drip-feed-content/
*
* You can add this recipe to your site by creating a custom plugin
@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/
*
*/
@dwanjuki
dwanjuki / add_excerpt_to_wordpress_page.php
Last active February 26, 2025 09:24 — 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_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_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 / 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/