Skip to content

Instantly share code, notes, and snippets.

Avatar

Kim Coleman kimcoleman

View GitHub Profile
@kimcoleman
kimcoleman / show_gravatar_pmpro_account_bullets_top.php
Created Feb 11, 2021 — 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.
View show_gravatar_pmpro_account_bullets_top.php
<?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 / my_pmpro_mailchimp_listsubscribe_fields.php
Last active Feb 10, 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 / 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_pmprommr_change_caps.php
Created Jul 7, 2020 — forked from dparker1005/my_pmprommr_change_caps.php
Changes membership manager so that they can only view the members list and add new members via PMPro Add Member.
View my_pmprommr_change_caps.php
<?php
// Copy from below here...
/*
* Changes membership manager so that they can only view
* the members list and add new members via PMPro Add Member.
*
* Can customize using your own caps from here:
* https://github.com/strangerstudios/pmpro-membership-manager-role/blob/35725b5cc9d7fd403255e4143a5bd5f1564b022d/pmpro-membership-manager-role.php#L16-L42
*/
@kimcoleman
kimcoleman / ninja_forms_field_membership_level.php
Last active Jun 5, 2020 — forked from ipokkel/ninja_forms_field_membership_level.php
Hidden Ninja Forms form field that captures PMPro membership level
View ninja_forms_field_membership_level.php
<?php
/*
* Add a hidden field in Ninja Forms to capture Membership Level (if user is logged in).
*
* For Ninja Forms version 3 and higher.
*/
// Create Membership Level field for Ninja Forms
add_filter( 'ninja_forms_register_fields', function( $fields ) {
if ( class_exists( 'PMProMembershipLevelNFInput' ) ) {
$fields['pmpromembershiplevel'] = new PMProMembershipLevelNFInput;
@kimcoleman
kimcoleman / redirect_non_members_to_levels_page.php
Last active May 16, 2020 — forked from andrewlimaza/redirect_users_to_a_new_page.php
Redirect non-members to the Membership Levels page in PMPro if they do not have a membership level.
View redirect_non_members_to_levels_page.php
<?php
/**
* Redirect non-members to the Membership Levels page if they do not have a membership level.
*
* 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_disable_member_emails.php
Last active Apr 27, 2020 — forked from strangerstudios/my_pmpro_disable_member_emails.php
Disable any email sent to the Member/User by Paid Memberships Pro
View my_pmpro_disable_member_emails.php
<?php
/**
* The function below will disable any email sent to the Member/User by Paid Memberships Pro.
* The admin emails will still be sent as intended.
*
* 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_paypal_button_image.php
Last active Aug 24, 2020 — forked from strangerstudios/my_pmpro_paypal_button_image.php
Using the pmpro_paypal_button_image filter to change the PayPal button image on the PMPro checkout page.
View my_pmpro_paypal_button_image.php
<?php
/**
* Change the PayPal button image on the Paid Memberships Pro - Membership Checkout 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 my_pmpro_paypal_button_image( $url ) {
@kimcoleman
kimcoleman / my_pmpro_member_links.php
Last active Mar 29, 2020 — forked from strangerstudios/my_pmpro_member_links
Example of how to add links to the Member Links list on the Membership Account page.
View my_pmpro_member_links.php
@kimcoleman
kimcoleman / my_default_wp_user_checkout_fields.php
Last active Feb 18, 2020 — forked from strangerstudios/my_default_wp_user_checkout_fields.php
Capture default user profile fields at Membership Checkout using Register Helper
View my_default_wp_user_checkout_fields.php
<?php
/**
* Add Website and Biographical Info to Membership Checkout
*/
function my_default_wp_user_checkout_fields() {
if ( class_exists( 'PMProRH_Field') ) {
pmprorh_add_checkout_box( 'additional', 'Additional Information' );
$fields = array();
//user_url field