Skip to content

Instantly share code, notes, and snippets.

@vanbo
Last active October 2, 2018 10:59
Show Gist options
  • Select an option

  • Save vanbo/2c94cb7a1da9441c7097aed0573b6a22 to your computer and use it in GitHub Desktop.

Select an option

Save vanbo/2c94cb7a1da9441c7097aed0573b6a22 to your computer and use it in GitHub Desktop.
Pay360 Limit Description to 255 chars
add_filter( 'pay360_hosted_cashier_get_parameters', 'prefix_limit_description', 10, 3 );
function prefix_limit_description($args, $order, $gateway) {
// Add, remove or update a parameter
// Limit the description to 252 chars and add ... at the end
$args['transaction']['description'] = substr( $args['transaction']['description'], 0, ( 252 ) ) . '...';
// Always return the arguments back
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment