Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created June 26, 2018 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kreamweb/a3ac8e255722e324282136afee8f75e3 to your computer and use it in GitHub Desktop.
Save kreamweb/a3ac8e255722e324282136afee8f75e3 to your computer and use it in GitHub Desktop.
<?php
if ( function_exists( 'ywsbs_get_subscription' ) ) {
add_action( 'ywsbs_renew_subscription', 'ywsbs_renew_subscription_additional_fields', 10, 2 );
function ywsbs_renew_subscription_additional_fields( $renew_order_id, $subscription_id ) {
$subscription = ywsbs_get_subscription( $subscription_id );
$order_id = $subscription->order_id;
$billing_persontype = get_post_meta( $order_id, '_billing_persontype', true );
$billing_cpf = get_post_meta( $order_id, '_billing_cpf', true );
update_post_meta( $renew_order_id, '_billing_persontype', $billing_persontype );
update_post_meta( $renew_order_id, '_billing_cpf', $billing_cpf );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment