Created
June 10, 2015 13:17
-
-
Save WillBrubaker/0e66c7a53cfcfecb16bd to your computer and use it in GitHub Desktop.
Change WooCommerce Subscriptions "Change Payment Method" text
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
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