Skip to content

Instantly share code, notes, and snippets.

View dparker1005's full-sized avatar

David Parker dparker1005

  • Stranger Studios
View GitHub Profile
<?php
/**
* Trigger admin activity email.
*
* To send a test email, go to yoursite.com/?test_admin_activity_email=1
*/
function pmpro_test_activity_email() {
if ( ! empty( $_REQUEST['test_admin_activity_email'] ) ) {
$email = new PMPro_Admin_Activity_Email;
@dparker1005
dparker1005 / my_pmpro_checkout_custom_template_path_use_default.php
Created April 2, 2024 13:33
Use the default PMPro checkout page template instead of a custom theme tempalate.
<?php
/**
* Use the default PMPro checkout page template instead of a custom theme tempalate.
*
* 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/
*/
@dparker1005
dparker1005 / checkout_levels_api_demo.php
Last active February 29, 2024 18:06
2 demos to demonstrate the PMPro checkout_levels API call.
<?php
// Copy from below here...
/*
* Add widget to checkout to get result of checkout_levels API call when button is pressed.
*/
function my_pmpro_test_checkout_levels_api() {
?>
<hr/>
@dparker1005
dparker1005 / memberslist_billing_address.php
Created February 28, 2024 16:12
Add the "billing address" column back to the members list and CSV export.
<?php
/**
* Add the "billing address" column back to the members list and CSV export.
*
* Note: This will add the most recent billing address for the user and level
* by looking at the user's order history, not user meta.
*
* 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.
@dparker1005
dparker1005 / my_remove_pmpro_search_filter_pmpro_pages.php
Last active February 23, 2024 20:20
Disable hiding PMPro pages from search.
<?php
/**
* Disable hiding PMPro pages from search.
*
* 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/
*/
@dparker1005
dparker1005 / my_pmpro_remove_change_level_link.php
Created August 13, 2019 18:50
Removes the 'change' button from the PMPro membership account page
@dparker1005
dparker1005 / disable-reporting-pmpro.php
Last active January 26, 2024 20:17 — forked from andrewlimaza/disable-reporting-pmpro.php
Disable Reporting For Paid Memberships Pro
<?php
/**
* Remove tracking for Paid Memberships Pro on high traffic sites.
*
* 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_disable_reporting() {
@dparker1005
dparker1005 / redirect_from_checkout_and_cancel.php
Created June 1, 2021 20:51
Prevent users from cancelling their membership or checking out for a new one.
<?php
// Copy from below here...
/**
* Prevent users from cancelling their membership or checking out for a new one.
*/
function my_pmpro_redirect_from_checkout_and_cancel() {
global $pmpro_pages;
@dparker1005
dparker1005 / my_pmpro_stripe_checkout_session_parameters_subscription_description.php
Last active December 22, 2023 14:19
Updates the payment description in Stripe when purchasing a subscription using Stripe Checkout.
<?php
/**
* 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.
*/
// Copy from below this line
/**
@dparker1005
dparker1005 / my_pmpromc_subscribe_extra_email.php
Last active November 30, 2023 15:06
Subscribe an extra email address to Mailchimp on checkout.
<?php
// Copy from below here
/*
* Subscribe an extra email address to Mailchimp on checkout.
*/
function my_pmpromc_subscribe_extra_email() {
global $pmpromc_audience_member_updates;