Forked from greathmaster/pmpro-stripe-order-description.php
Created
October 26, 2021 18:05
-
-
Save kimwhite/bae9a94393ce765e29e6797122f4fd4f to your computer and use it in GitHub Desktop.
Add the membership level ID and name to the Stripe description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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