Skip to content

Instantly share code, notes, and snippets.

@thenbrent
Last active June 7, 2016 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thenbrent/8e4bda5a53b91addc68b to your computer and use it in GitHub Desktop.
Save thenbrent/8e4bda5a53b91addc68b to your computer and use it in GitHub Desktop.
Reinstate old Subscription renewal order item name
<?php
/*
Plugin Name: WooCommerce Subscriptions Reinstate Old Renewal Order Item Name
Plugin URI: https://gist.github.com/thenbrent/8e4bda5a53b91addc68b
Description: Reinstate the "Renewal of {product_title} purchased in Order {order_id}" string on renewal order items.
Author:
Author URI:
Version: 0.3
*/
/**
* Whenever a new renewal order is created, add the "Renewal of {product_title} purchased in Order {order_id}" to the order item's name.
*/
function eg_reinstate_renewal_of_to_renewal_title( $renewal_order_item_name, $order_item, $subscription ) {
return sprintf( __( 'Renewal of "%s" purchased in Subscription %s', 'woocommerce-subscriptions' ), $renewal_order_item_name, $subscription->get_order_number() );
}
add_filter( 'wcs_renewal_order_item_name', 'eg_reinstate_renewal_of_to_renewal_title', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment