Skip to content

Instantly share code, notes, and snippets.

@thenbrent
Last active November 12, 2021 19:59
Show Gist options
  • Save thenbrent/2b2b328b1413e563adfb to your computer and use it in GitHub Desktop.
Save thenbrent/2b2b328b1413e563adfb to your computer and use it in GitHub Desktop.
Change the name of the "Pending Cancellation" status in WooCommerce Subscriptions to be "Cancelled Payments".
<?php
/**
* Plugin Name: WooCommerce Subscriptions Change Pending Cancellation Status
* Plugin URI: https://gist.github.com/thenbrent/2b2b328b1413e563adfb
* Description: Change the name of the "Pending Cancellation" status in WooCommerce Subscriptions to be "Cancelled Payments".
* Author: Prospress Inc.
* Version: 1.0
* Author URI: http://prospress.com
*/
function eg_change_pending_cancellation_status( $subscription_statuses ) {
$subscription_statuses['wc-pending-cancel'] = _x( 'Cancelled Payments', 'Subscription status', 'woocommerce-subscriptions' );
return $subscription_statuses;
}
add_action( 'wcs_subscription_statuses', 'eg_change_pending_cancellation_status', 0 );
function eg_change_pending_cancellation_status_admin( $subscription_statuses ) {
$subscription_statuses['wc-pending-cancel'] = _nx_noop( 'Cancelled Payments <span class="count">(%s)</span>', 'Cancelled Payments <span class="count">(%s)</span>', 'post status label including post count', 'woocommerce-subscriptions' );
return $subscription_statuses;
}
add_action( 'woocommerce_subscriptions_registered_statuses', 'eg_change_pending_cancellation_status_admin', 0 );
@oo-matty
Copy link

I realize this is ancient stuff, but is there a snippet for modifying the other subscription statuses (wc-on-hold, etc)? I haven't found any other comments or snippets that will tackle this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment