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_paypal_button_image.php
Last active April 14, 2021 03:27 — 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.
<?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_disable_member_emails.php
Last active April 14, 2021 03:30 — forked from strangerstudios/my_pmpro_disable_member_emails.php
Disable any email sent to the Member/User by Paid Memberships Pro
<?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_reports_extras.php
Last active April 16, 2021 01:23 — forked from strangerstudios/my_pmpro_reports_extras
Add a Custom Report to the Memberships > Reports Screen in Paid Memberships Pro.
<?php
/**
* Add a Custom Report to the Memberships > Reports Screen in Paid Memberships Pro.
*
* For each report, add a line like:
* global $pmpro_reports;
* $pmpro_reports['slug'] = 'Title';
*
* For each report, also write two functions:
* pmpro_report_{slug}_widget() to show up on the report homepage.
@kimcoleman
kimcoleman / dynamic_pmpro_levels_array.php
Created May 12, 2021 20:37 — forked from ipokkel/dynamic_pmpro_levels_array.php
Dynamically display certain levels on the Membership Levels page based on the current user's active level
<?php
/**
* Dynamically display certain levels on the Membership Levels page based on the current user's active level
* This example allows you to show/hide specific levels on the Membership Levels page.
*/
/**
* Dynamically display certain levels on the Membership Levels page based on the current user's active level
* This example allows you to show/hide specific levels on the Membership Levels page.
*/
function dynamic_pmpro_levels_array( $levels ) {
@kimcoleman
kimcoleman / my_pmpro_set_application_fee_percentage.php
Created August 12, 2021 21:13 — forked from dparker1005/my_pmpro_set_application_fee_percentage.php
Modify the application fee percentage that is charged on Stripe transactions.
<?php
/**
* Modify the application fee percentage that is charged on Stripe transactions.
*
* 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 / pmprodon_pmpro_donation_recurring.php
Last active January 22, 2022 12:03 — forked from andrewlimaza/pmpro-recurring-donations.php
Adds recurring donation functionality to the Donations Add On for Paid Memberships Pro: https://www.paidmembershipspro.com/add-ons/donations-add-on/
<?php
/*
* This gist adds recurring functionality to the Donations Add On for Paid Memberships Pro.
* It adds the user-entered 'donation amount' to their recurring billing amount.
*/
//add donation amount to recurring payment amount
function pmprodon_pmpro_donation_recurring( $level ) {
if( isset( $_REQUEST['donation'] ) ) {
$donation = preg_replace( '[^0-9\.]', '', $_REQUEST['donation'] );
@kimcoleman
kimcoleman / pmpro_expiration_date_shortcode_bbpress_profile.php
Last active February 21, 2022 11:39 — forked from strangerstudios/pmpro_expiration_date_shortcode_bbpress_profile.php
Show a member's expiration date on bbPress profile page.
<?php
/**
* Use this recipe in conjunction with PMPro bbPress Add On to show the expiration date on single forum user profile.
*
* 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_bbp_template_before_user_profile_pmpro_expiration_date() {
$user_id = bbp_get_user_id( 0, true, false );
@kimcoleman
kimcoleman / next_last_payment_dates_members_list.php
Last active July 5, 2022 14:59 — 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).
<?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 / hide-confirm-email-password.php
Last active October 19, 2022 18:25 — forked from strangerstudios/gist:4027538
Hide the confirm email and confirm password fields from the Paid Memberships Pro checkout page.
<?php
/*
* Don't show confirm password or email fields on the 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/
*/
add_filter( 'pmpro_checkout_confirm_password', '__return_false' );
@kimcoleman
kimcoleman / my_pmpro_member_links.php
Last active April 10, 2023 12:51 — forked from strangerstudios/my_pmpro_member_links
Example of how to add links to the Member Links list on the Membership Account page.