Skip to content

Instantly share code, notes, and snippets.

View kimcoleman's full-sized avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / my_pmpro_change_level_edd_update_payment_status.php
Last active March 13, 2021 19:20 — forked from andrewlimaza/change-level-edd.php
Change user's membership level when a product is purchased in Easy Digital Downloads.
<?php
/**
* This recipe will allow you to assign a membership level to members when purchasing an EDD product.
* You can do this one of two ways:
*
* OPTION 1: Product ID and Membership Level
* $product_levels = array(
27 => 1, //27 is the EDD product ID. 1 is the membership level they get when purchasing product 27
);
*
@kimcoleman
kimcoleman / my_ffl_display_name_order.php
Last active March 12, 2021 19:17
Change the display name to default to LAST FIRST using the Force First Last WordPress plugin.
<?php
/*
* Change the display name to default to LAST FIRST using the Force First Last WordPress plugin.
* https://wordpress.org/plugins/force-first-last/
*
* 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.
*/
function my_ffl_display_name_order( $display_name_order, $first_name, $last_name ) {
$display_name_order = array( $last_name, $first_name );
@kimcoleman
kimcoleman / show_parent_expiration_date_for_child.php
Last active March 9, 2021 20:38
Show the parent account's expiration for the child.
<?php
/*
* Show the parent account's expiration for the child in various places on frontend and admin pages in PMPro.
*
* 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 replace_parent_expiration_for_child( $user_id ) {
@kimcoleman
kimcoleman / show_gravatar_pmpro_account_bullets_top.php
Created February 11, 2021 01:19 — forked from strangerstudios/my_pmpro_account_bullets_avatars.php
Display a member's gravatar and a link to update at Gravatar on the Membership Account page "Profile" section.
<?php
/*
* Show a link to Gravatar and an avatar preview on the Profile section of the Membership Account 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/
*/
function show_gravatar_pmpro_account_bullets_top() {
@kimcoleman
kimcoleman / custom_suffix_pmpro_affiliates_new_code.php
Created January 19, 2021 18:20
Filter to adjust the generated code for the Affiliates Add On.
<?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 October 7, 2021 17:27
Remove default columns from the Members List. In this example, we are removing Level and Level ID columns.
<?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 February 10, 2021 22:08 — 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.
<?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 December 29, 2020 21:54
Override the Advanced Setting to hide excerpts if this is 'page' post type in Paid Memberships Pro.
<?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 June 16, 2023 17:09
Override the Advanced Setting to hide excerpts if this is an Addon Package single post.
<?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 December 11, 2020 17:16
Remove the prefix if it is a category archive or post type archive.
<?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/
*/