I'm using the following code to set a subscription to "on-hold" on clicking the button. The problem I have is that it redirects to "my-account/view-subscription/949/" (949 being the sub id) rather than reloading the current page - /my-account/subscriptions/.
Is there a way to reload the current page rather than going to the individual sub?
<?php $current_status = $subscription->get_status($sub_id);
$subscription_url = "/my-account/subscriptions/";
$pause_url = $subscription_url . '?subscription_id=' . $sub_id . '&change_subscription_to=on-hold';
$pause_subscription_url = wp_nonce_url( $pause_url, $sub_id . $current_status ); ?>
<div class="sub-action-container">
<a href="<?php echo $pause_subscription_url; ?>" class="button totm-bg-purple-rosepink-lr">Pause</a>
</div>
question from:
https://stackoverflow.com/questions/65843833/reload-current-page-on-submit-rather-than-being-directed-to-individual-sub-page 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…