Skip to content

Instantly share code, notes, and snippets.

Avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / custom_suffix_pmpro_affiliates_new_code.php
Created Jan 19, 2021
Filter to adjust the generated code for the Affiliates Add On.
View custom_suffix_pmpro_affiliates_new_code.php
<?php
/**
* Filter to adjust the generated code for the Affiliates 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 / custom_manage_memberslist_columns.php
Last active Jan 7, 2021
Remove default columns from the Members List. In this example, we are removing Level and Level ID columns.
View custom_manage_memberslist_columns.php
<?php
/**
* Remove default columns from the Members List. In this example, we are removing Level and Level ID columns.
* You can also optionally toggle these columns off manually in the "Screen Options" area.
*
* 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 / my_pmpro_mailchimp_listsubscribe_fields.php
Last active Jan 4, 2021 — forked from strangerstudios/my_pmpro_mailchimp_listsubscribe_fields.php
Example of using the pmpro_mailchimp_listsubscribe_fields filter to send extra fields to Mailchimp. The fields must be created in Mailchimp first, or you must used the pmpro_mailchimp_merge_fields filter to create them.
View my_pmpro_mailchimp_listsubscribe_fields.php
<?php
/**
* Sync additional user fields to Mailchimp.
* You must create the fields in Mailchimp first.
* Or, you can use the `pmpro_mailchimp_merge_fields` filter to create them through the API.
*
* 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 / option_pmpro_showexcerpts_on_pages.php
Last active Dec 29, 2020
Override the Advanced Setting to hide excerpts if this is 'page' post type in Paid Memberships Pro.
View option_pmpro_showexcerpts_on_pages.php
<?php
/*
* Override the Advanced Setting to hide excerpts if this is 'page' post type.
*
* 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 / option_pmpro_showexcerpts_on_addon_packages.php
Last active Dec 29, 2020
Override the Advanced Setting to hide excerpts if this is an Addon Package single post.
View option_pmpro_showexcerpts_on_addon_packages.php
<?php
/*
* Override the Advanced Setting to hide excerpts if this is an Addon Package single post.
*
* 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 / memberlite_remove_prefix_from_the_archive_title.php
Created Dec 11, 2020
Remove the prefix if it is a category archive or post type archive.
View memberlite_remove_prefix_from_the_archive_title.php
<?php
/**
* Remove the prefix if it is a category archive or post type archive.
*
* You can add this recipe to your site by creating a custom plugin,
* adding the customization to a Memberlite child theme,
* 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://memberlitetheme.com/create-a-plugin-for-customizations-to-your-memberlite-site/
*/
@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;