Skip to content

Instantly share code, notes, and snippets.

Avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / next_last_payment_dates_members_list.php
Last active Nov 26, 2020 — 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).
View next_last_payment_dates_members_list.php
<?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 Nov 17, 2020
Hide the membership pricing box on Sitewide Sales Landing Page checkout form and replace with our own.
View maybe_add_choose_level_section_swsales.php
<?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 Nov 17, 2020
Filters the array of available banner templates for Sitewide Sales: https://sitewidesales.com
View add_custom_swsales_banner_templates.php
<?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 Nov 17, 2020
Adds a "Black Friday" template name to the array of available landing page templates for Sitewide Sales: https://sitewidesales.com
View add_custom_swsales_landing_page_templates.php
<?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 Nov 3, 2020
Add Contact Form 7 to the Profile page's Memberlite Sidebar when using the Member Directory and Profiles Add On for Paid Memberships Pro.
View my_memberlite_cf7_profile_page_before_sidebar_widgets.php
<?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 Oct 2, 2020
Allow large JOIN operations in the Member Directory and Profiles Add On for Paid Memberships Pro.
View pmpromd_set_db_option.php
<?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 Oct 1, 2020
Sample content for the landing page in our demo webinar titled: "Create a Landing Page to Capture Email Addresses"
View sample-content-landing-page-capture-email.html
<!-- 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 Oct 1, 2020
Require a sponsor code for the "child" level checkout when using Paid Memberships Pro and the Sponsored/Group Membership Add On.
View pmprosm_discount_code_required.php
<?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 Oct 1, 2020
Remove a specific Stripe JavaScript library from loading on the checkout page. This recipe removes the library loaded by the Charitable plugin.
View stop_other_stripe_js_loading_on_checkout.php
<?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 Sep 24, 2020
Sample content for Sitewide Sales: Neon Template for WooCommerce
View WooCommerce-Neon-Sitewide-Sale.html
/**
* 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>
You can’t perform that action at this time.