Last active
April 16, 2020 14:39
-
-
Save jessepearson/d870d34363d84d034d88d791a3a3c8d0 to your computer and use it in GitHub Desktop.
Allows the editing of the PayPal Standard Subscription ID even if it shouldn't be edited. Use at own risk.
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 // do not copy this line | |
/** | |
* Allows the editing of the PayPal Standard Subscription ID even if it shouldn't be edited. | |
* Use at own risk. | |
*/ | |
function jp_allow_edit_of_pp_standard_sub_payment_20200416( $payment_meta, $subscription ) { | |
// Make sure that what we're going to edit exists. | |
if ( isset( $payment_meta['paypal'] ) | |
&& isset( $payment_meta['paypal']['post_meta'] ) | |
&& isset( $payment_meta['paypal']['post_meta']['_paypal_subscription_id'] ) | |
) { | |
// Set disabled to false to allow editing. | |
$payment_meta['paypal']['post_meta']['_paypal_subscription_id']['disabled'] = false; | |
} | |
return $payment_meta; | |
} | |
add_filter( 'woocommerce_subscription_payment_meta', 'jp_allow_edit_of_pp_standard_sub_payment_20200416', 100,2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment