Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimwhite/bae9a94393ce765e29e6797122f4fd4f to your computer and use it in GitHub Desktop.
Save kimwhite/bae9a94393ce765e29e6797122f4fd4f to your computer and use it in GitHub Desktop.
Add the membership level ID and name to the Stripe description
<?php // do not copy this line.
/**
* Add the membership level ID and name to the Stripe description
*
* 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_stripe_order_description($description, $order)
{
$membership_level = $order->getMembershipLevel();
$description = "ID: ".$membership_level->id. ", ".$membership_level->name.", ".$description;
return $description;
}
add_filter('pmpro_stripe_order_description', 'my_pmpro_stripe_order_description', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment