Skip to content

Instantly share code, notes, and snippets.

View kimcoleman's full-sized avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / next_last_payment_dates_members_list.php
Last active July 5, 2022 14:59 — forked from strangerstudios/nextlastpayments.php
Adds last payment date and next payment date to the members list and export CSV in Paid Memberships Pro (PMPro).
<?php
/**
* Adds last payment date and next payment date to the members list and export CSV.
* Note that "last payment" value will get the last order in "success", "cancelled", or "" status. (Oddly enough, cancelled here means that the membership was cancelled, not the order.)
*
* The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date. It may be off from the actual recurring date set at the gateway, especially if the subscription was updated at the gateway.
*
* 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.
@kimcoleman
kimcoleman / maybe_add_choose_level_section_swsales.php
Created November 17, 2020 21:06
Hide the membership pricing box on Sitewide Sales Landing Page checkout form and replace with our own.
<?php
/**
* Hide the membership pricing box on Landing Page checkout form and replace with our own.
*
* Requires Paid Memberships Pro and Sitewide Sales.
*
*/
function maybe_add_choose_level_section_swsales( $include_pricing_fields ) {
global $wpdb, $pmpro_level;
@kimcoleman
kimcoleman / add_custom_swsales_banner_templates.php
Created November 17, 2020 20:32
Filters the array of available banner templates for Sitewide Sales: https://sitewidesales.com
<?php
/*
* Filters the array of available banner templates for Sitewide Sales (https://sitewidesales.com).
*
* @param array $templates The default list of available templates.
*/
function add_custom_swsales_banner_templates( $templates ) {
$templates['black-friday'] = 'Black Friday'; // This is how you add a new template to the array.
//unset( $templates['neon'] ); // This is how you unset an included template from the array.
return $templates;
@kimcoleman
kimcoleman / add_custom_swsales_landing_page_templates.php
Last active November 17, 2020 20:31
Adds a "Black Friday" template name to the array of available landing page templates for Sitewide Sales: https://sitewidesales.com
<?php
/*
* Filters the array of available landing page templates for Sitewide Sales (https://sitewidesales.com).
*
* @param array $templates The default list of available templates.
*/
function add_custom_swsales_landing_page_templates( $templates ) {
$templates['black-friday'] = 'Black Friday'; // This is how you add a new template to the array.
//unset( $templates['neon'] ); // This is how you unset an included template from the array.
return $templates;
@kimcoleman
kimcoleman / my_memberlite_cf7_profile_page_before_sidebar_widgets.php
Created November 3, 2020 16:38
Add Contact Form 7 to the Profile page's Memberlite Sidebar when using the Member Directory and Profiles Add On for Paid Memberships Pro.
<?php
/**
* Add Contact Form 7 to the Profile page when using the Member Directory and Profiles Add On for Paid Memberships Pro.
* Update line 36 with the correct CF7 shortcode for your desired form to display.
* Add a hidden field to your form: "[hidden send-to-email default:shortcode_attr]".
* Set the "To" field of the Contact Form to "[send-to-email]".
*
*/
// Allow custom shortcode attribute for "send-to-email".
@kimcoleman
kimcoleman / pmpromd_set_db_option.php
Created October 2, 2020 14:20
Allow large JOIN operations in the Member Directory and Profiles Add On for Paid Memberships Pro.
<?php
/*
* Allow large JOIN operations in the Member Directory and Profiles Add On for Paid Memberships Pro.
*
* 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/
*
*/
@kimcoleman
kimcoleman / sample-content-landing-page-capture-email.html
Last active October 1, 2020 17:16
Sample content for the landing page in our demo webinar titled: "Create a Landing Page to Capture Email Addresses"
<!-- Landing Page Content -->
[membership level="0"]This tutorial video shows you how to add a free membership level and set up a landing page to capture subscribers. Sign up now to access the video![/membership]
[membership level="1"]
https://youtu.be/6q4882GypxY
[/membership]
[membership level="0"]
[pmpro_signup level="1" title="Sign Up to Watch" short="true" intro="Enter your email address and create a password to gain access."]
[/membership]
@kimcoleman
kimcoleman / pmprosm_discount_code_required.php
Created October 1, 2020 15:42
Require a sponsor code for the "child" level checkout when using Paid Memberships Pro and the Sponsored/Group Membership Add On.
<?php
/*
* Require a sponsor code for the "child" level checkout when using
* Paid Memberships Pro and the Sponsored/Group Membership 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/
*
@kimcoleman
kimcoleman / stop_other_stripe_js_loading_on_checkout.php
Created October 1, 2020 15:14
Remove a specific Stripe JavaScript library from loading on the checkout page. This recipe removes the library loaded by the Charitable plugin.
<?php
/*
* Remove a specific Stripe JavaScript library from loading on the checkout page.
* This recipe removes the library loaded by the Charitable plugin.
*
* 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/
*
@kimcoleman
kimcoleman / WooCommerce-Neon-Sitewide-Sale.html
Created September 24, 2020 11:55
Sample content for Sitewide Sales: Neon Template for WooCommerce
/**
* Sale Type: WooCommerce
* Sale Template: Neon
*/
// Pre-Sale Content:
<h1>The Illuminated Sale Coming Soon!</h1>
<h4>Get ready for the most lit-up sale ever! Coming October 2055!</h4>
<p><a href="#">Learn More</a></p>