Skip to content

Instantly share code, notes, and snippets.

@messica
Last active July 1, 2019 16:35
Show Gist options
  • Save messica/2fca81645b06fd69660aeee1556bc2bc to your computer and use it in GitHub Desktop.
Save messica/2fca81645b06fd69660aeee1556bc2bc to your computer and use it in GitHub Desktop.
Change to change PayPal order description to "billing_name - level_name".
<?php
/**
* Change PayPal order description to "billing_name - level_name".
*/
function my_pmpro_paypal_level_description( $description, $level_name, $order, $site_name ) {
// Get name from billing address.
$name = $order->billing->name;
$description = "{$name} - {$level_name}";
return $description;
}
add_filter( 'pmpro_paypal_level_description', 'my_pmpro_paypal_level_description', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment