Last active
November 12, 2021 19:59
-
-
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".
This file contains hidden or 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 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 ); |
@Dennis-TheCoffeeCollective where it says:
$subscription_statuses;
Change to:
return $subscription_statuses;
I've just fixed up the issue with returning the statuses. :)
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
bvdr - where did you put in that line?
Cause I can't get it to work. The text is changed to "pending-cancel" instead of "Cancelled Payments".