Last active
June 7, 2016 14:57
-
-
Save thenbrent/8e4bda5a53b91addc68b to your computer and use it in GitHub Desktop.
Reinstate old Subscription renewal order item name
This file contains 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 | |
/* | |
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