Skip to content

Instantly share code, notes, and snippets.

@WillBrubaker
Created June 10, 2015 13:17
Show Gist options
  • Save WillBrubaker/0e66c7a53cfcfecb16bd to your computer and use it in GitHub Desktop.
Save WillBrubaker/0e66c7a53cfcfecb16bd to your computer and use it in GitHub Desktop.
Change WooCommerce Subscriptions "Change Payment Method" text
add_filter( 'woocommerce_change_payment_button_text', 'wooninja_change_payment_button_text' );
function wooninja_change_payment_button_text() {
return 'MY BUTTON TEXT';
}
add_filter( 'woocommerce_my_account_my_subscriptions_actions', 'wooninja_filter_subscriptions_actions', 99 );
function wooninja_filter_subscriptions_actions( $actions ) {
foreach ( $actions as $key => $value ) {
if ( isset( $actions[ $key ]['change_payment_method'] ) ) {
error_log( print_r( $value, true ) );
$actions[ $key ]['change_payment_method']['name'] = apply_filters( 'woocommerce_change_payment_button_text', __( 'Change Payment Method', 'woocommerce-subscriptions' ) );
}
}
return $actions;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment