Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
251 views
in Technique[技术] by (71.8m points)

php - Reload current page on submit rather than being directed to individual sub page

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...