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_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 / 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 / custom_pmpro_upcoming_recurring_payment_reminder.php
Last active Dec 16, 2020
Filter to modify the days prior to renewal that the Recurring Payment Email Reminders Add On sends members the membership_recurring email notifcation.
View custom_pmpro_upcoming_recurring_payment_reminder.php
<?php
/**
* Filter to modify the days prior to renewal that the Recurring Payment Email Reminders Add On
* sends members the membership_recurring email notifcation.
*
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function custom_pmpro_upcoming_recurring_payment_reminder( $rec_array ) {
$rec_array = array( 30 => 'membership_recurring', );
return $rec_array;
@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 / remove_woocommerce_account_content.php
Last active Nov 30, 2020
Remove the welcome message from the WooCommerce My Account page.
View remove_woocommerce_account_content.php
<?php
/**
* Remove the welcome message from the WooCommerce My Account page.
*/
function remove_woocommerce_account_content() {
if ( function_exists( 'pmpro_getMembershipLevelForUser' ) ) {
$level = pmpro_getMembershipLevelForUser();
if ( esc_attr( $level->ID ) === '4' ) {
remove_action( 'woocommerce_account_content', 'woocommerce_account_content' );
}
@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 / my_pmpro_required_billing_fields.php
Last active Nov 25, 2020
Make sure address fields are required
View my_pmpro_required_billing_fields.php
<?php
/**
* Make sure Billing Address fields are required.
*
* 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_required_billing_fields( $fields ) {